npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@videsk/id-watermark

v1.0.0

Published

Creates holographic watermarks in images

Downloads

1

Readme

IDWatermark

A modern library for creating holographic watermarks in images using OffscreenCanvas. Perfect for document protection, digital certificates, or any image requiring a holographic watermark effect.

Spanish: Read here.

Features

  • ✨ Customizable holographic effects
  • 🎨 Full control over colors and gradients
  • 🖼️ Support for multiple image formats
  • 🚀 Optimized performance with OffscreenCanvas
  • 👷 Web Workers compatible
  • 🔄 Asynchronous processing

watermark-id

Installation

npm install @videsk/id-watermark

Basic Usage

import IDWatermark from '@videsk/id-watermark';

const watermarker = new IDWatermark();

// Process an image
const imageBlob = await fetch('image.jpg').then(r => r.blob());
const watermarkedBlob = await watermarker.addWatermark(imageBlob, 'CONFIDENTIAL');

Configuration

The library accepts the following configuration options:

const watermarker = new IDWatermark({
  fontSize: 12,          // Font size
  fontFamily: 'Courier New', // Font family
  opacity: 1,           // Watermark opacity (0-1)
  baseHue: 270,         // Base color (0-360)
  hueStep: 3,           // Color increment between characters
  grayscale: false,     // Convert image to grayscale
  bitmapOptions: {}     // Options for createImageBitmap
});

Understanding Hue Values

The holographic effect is based on HSL (Hue, Saturation, Lightness) color space manipulation. The hue parameter determines the base color and its progression:

baseHue (0-360)

The baseHue value represents the initial color in the chromatic circle:

  • 0/360: Red
  • 60: Yellow
  • 120: Green
  • 180: Cyan
  • 240: Blue
  • 270: Violet (default value)
  • 300: Magenta

hueStep

The hueStep controls how much the color changes between consecutive characters:

  • Low values (1-5): Smooth and gradual changes
  • Medium values (5-15): Moderate rainbow effect
  • High values (15+): Dramatic color changes

Combination Examples

// Subtle holographic effect in violet tones
const subtleHolographic = new IDWatermark({
  baseHue: 270,
  hueStep: 3
});

// Vibrant rainbow effect
const rainbowEffect = new IDWatermark({
  baseHue: 0,
  hueStep: 15
});

// Blue monochromatic effect
const blueMonochrome = new IDWatermark({
  baseHue: 240,
  hueStep: 1
});

API

Main Methods

addWatermark(imageInput, watermarkText, encodeOptions)

Adds a watermark to an image.

const result = await watermarker.addWatermark(
  imageBlob,
  'CONFIDENTIAL',
  { type: 'image/jpeg', quality: 0.9 }
);
Parameters
  • imageInput: File | Blob | ImageData | ImageBitmap | OffscreenCanvas | VideoFrame | HTMLImageElement
  • watermarkText: string
  • encodeOptions: Object (optional)
    • type: string (e.g., 'image/jpeg', 'image/png')
    • quality: number (0-1)

Configurable Properties

All properties can be modified at runtime:

watermarker.fontSize = 24;
watermarker.opacity = 0.7;
watermarker.baseHue = 180;

Web Workers Usage (Conceptual Example)

// main.js
const worker = new Worker('watermark.worker.js', { type: 'module' });

// Send task to worker
worker.postMessage({
  type: 'ADD_WATERMARK',
  payload: {
    image: imageBlob,
    text: 'CONFIDENTIAL',
    options: { baseHue: 270, hueStep: 3 }
  }
}, [imageBlob]);

// Receive result
worker.onmessage = (e) => {
  if (e.data.type === 'WATERMARK_COMPLETE') {
    const watermarkedBlob = e.data.payload;
    // Use the resulting blob
  }
};

Browser Compatibility

  • Modern browsers with OffscreenCanvas support
  • Chrome 69+
  • Firefox 79+
  • Edge 79+
  • Safari 16.4+

License

MIT