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

@affectively/synthetic-watermark

v1.0.0

Published

Invisible watermarking for AI-generated content. Embeds synthetic origin markers into PNG images (iTXt chunks) and MP3 audio (ID3v2 tags) for authenticity verification.

Readme

@affectively/synthetic-watermark

Invisible watermarking for AI-generated content. Embeds synthetic origin markers into PNG images and MP3 audio files for authenticity verification and AI safety compliance.

Features

  • Image Watermarking - Embeds invisible metadata into PNG files using iTXt chunks
  • Audio Watermarking - Embeds metadata into MP3 files using ID3v2 tags
  • Detection - Verify if content has synthetic origin markers
  • Zero Dependencies - Uses only Node.js Buffer API
  • Non-Destructive - Watermarks are stored in metadata, not visible/audible content
  • AI Safety - Helps identify AI-generated content for authenticity verification

Installation

npm install @affectively/synthetic-watermark
# or
bun add @affectively/synthetic-watermark
# or
yarn add @affectively/synthetic-watermark

Quick Start

Image Watermarking

import {
  embedImageWatermark,
  detectSyntheticImageWatermark,
} from '@affectively/synthetic-watermark';

// Watermark an AI-generated image
const pngBuffer = await fs.readFile('ai-generated-image.png');
const watermarkedImage = embedImageWatermark(pngBuffer, 'png', {
  source: 'dalle',
  model: 'dall-e-3',
  platform: 'MyApp',
});

// Save the watermarked image
await fs.writeFile('watermarked-image.png', watermarkedImage);

// Detect watermark
const detected = detectSyntheticImageWatermark(watermarkedImage);
if (detected) {
  console.log('Synthetic origin detected:', detected);
  // { platform: 'MyApp', source: 'dalle', model: 'dall-e-3', timestamp: 1234567890 }
}

Audio Watermarking

import {
  embedAudioWatermark,
  detectSyntheticWatermark,
} from '@affectively/synthetic-watermark';

// Watermark AI-generated audio
const mp3Buffer = await fs.readFile('tts-audio.mp3');
const watermarkedAudio = embedAudioWatermark(mp3Buffer, 'mp3', {
  source: 'tts',
  platform: 'MyApp',
});

// Save the watermarked audio
await fs.writeFile('watermarked-audio.mp3', watermarkedAudio);

// Detect watermark
const detected = detectSyntheticWatermark(watermarkedAudio);
if (detected) {
  console.log('Synthetic audio detected:', detected);
  // { platform: 'MyApp', source: 'tts', timestamp: 1234567890 }
}

Convenience Functions

For Images

import {
  watermarkDallEImage,
  watermarkGeminiImage,
  watermarkDigitalTwinImage,
  watermarkCyranoImage,
} from '@affectively/synthetic-watermark';

// Pre-configured for specific AI image generators
const watermarked = watermarkDallEImage(imageBuffer, 'png', optionalUserIdHash);

For Audio

import {
  watermarkDigitalTwinAudio,
  watermarkHologramAudio,
  watermarkCyranoAudio,
} from '@affectively/synthetic-watermark';

// Pre-configured for specific TTS systems
const watermarked = watermarkCyranoAudio(audioBuffer, 'mp3');

Watermark Format

Image Watermark (PNG iTXt chunk)

SyntheticOrigin: SYNTHETIC_IMAGE|platform|source|timestamp|userIdHash|model

Audio Watermark (ID3v2 COMM frame)

SYNTHETIC_ORIGIN: SYNTHETIC_AUDIO|platform|source|timestamp|userIdHash

API Reference

Image Functions

embedImageWatermark(buffer, format, config?)

Embeds an invisible watermark into a PNG image.

  • buffer - Image data (Uint8Array)
  • format - Image format (currently only 'png' supported)
  • config - Optional configuration:
    • platform - Platform identifier (default: 'SYNTHETIC')
    • source - Source system (e.g., 'dalle', 'gemini')
    • model - Model name (e.g., 'dall-e-3')
    • userIdHash - Hashed user ID for audit trail

Returns: Watermarked image buffer

detectSyntheticImageWatermark(buffer)

Detects and extracts watermark from PNG image.

Returns: ImageWatermarkConfig | null

Audio Functions

embedAudioWatermark(buffer, format, config?)

Embeds an invisible watermark into MP3 audio.

  • buffer - Audio data (Buffer)
  • format - Audio format (currently only 'mp3' supported)
  • config - Optional configuration:
    • platform - Platform identifier (default: 'SYNTHETIC')
    • source - Source system (e.g., 'tts', 'hologram')
    • userIdHash - Hashed user ID for audit trail

Returns: Watermarked audio buffer

detectSyntheticWatermark(buffer)

Detects and extracts watermark from MP3 audio.

Returns: WatermarkConfig | null

Use Cases

  1. AI Safety Compliance - Mark AI-generated content for authenticity verification
  2. Content Authentication - Verify the origin of synthetic media
  3. Audit Trail - Track when and by whom content was generated
  4. Platform Trust - Help users identify AI-generated content
  5. Regulatory Compliance - Support emerging AI content disclosure requirements

Technical Details

PNG Watermarking

  • Uses iTXt (International Text) chunk per PNG specification
  • Inserted before IEND chunk
  • Includes proper CRC32 checksum
  • Non-destructive to image data

MP3 Watermarking

  • Uses ID3v2.3 COMM (Comment) frame
  • Replaces existing ID3 tag if present
  • Syncsafe integer encoding for size
  • Compatible with standard ID3 readers

Browser Support

Works in Node.js and browser environments (requires Buffer polyfill in browser).

License

MIT © AFFECTIVELY