Skip to content

Releases: yyyoichi/watermark_zero

v0.2.3

Choose a tag to compare

@yyyoichi yyyoichi released this 03 Jan 14:09
eacc32c

What's Changed

Full Changelog: v0.2.2...v0.2.3

v0.2.1

Choose a tag to compare

@yyyoichi yyyoichi released this 26 Dec 03:47
1acb9fe

What's Changed

Full Changelog: v0.2.0...v0.2.1

v0.2.0

Choose a tag to compare

@yyyoichi yyyoichi released this 08 Dec 07:45
f15d26b

What's Changed

  • Refactor wzeromark: move to root, rename MarkLen→MarkSize, change mark type []bool→[]byte by @Copilot in #3
  • Fix typos: factroy → factory, lenght → length by @Copilot in #6
  • Refactor: Introduce EmbedMark/ExtractMark interfaces and improve mark handling by @yyyoichi in #4
  • Add comprehensive watermark experiments framework with database and visualization by @yyyoichi in #5
  • fix: Store version as 0x80 to reserve lower bits for future extensions by @yyyoichi in #7

Full Changelog: v0.1.1...v0.2.0

v0.1.1 Release

Choose a tag to compare

@yyyoichi yyyoichi released this 06 Nov 05:30

Added a simple package to convert strings to boolean values.

  • strmark.Encode converts a string to a byte array and represents each bit as a boolean value. The output length is always 8 times the input length.
  • Added strmark.Decode for reverse conversion.

The wzeromark package now publicly provides the encoding and decoding methods for marks used in the Watermark-ZeroAPI infrastructure service.

  • W-ZeroAPI combines multiple algorithms to prevent mark tampering, impersonation, and unauthorized reading.
  • Marks are HMAC-hashed and signed as a whole.
  • Secret keys are securely rotated.

For details, see README.md.

Initial Release

Choose a tag to compare

@yyyoichi yyyoichi released this 30 Oct 08:55

Version 1.0.0 - Initial Release

Release Date: October 30, 2025

🎉 Initial Release

We're excited to announce the first release of watermark_zero, a high-efficiency Go implementation inspired by the digital watermarking techniques from guofei9987/blind_watermark.

✨ Key Features

Core Watermarking Engine

  • Multi-domain watermarking approach combining YUV color space, Haar wavelets, DCT, and SVD transforms
  • Blind watermark embedding and extraction - no original image required for extraction
  • Concurrent processing for optimal performance across YUV color channels
  • Robust bit sequence embedding with k-means clustering for reliable extraction

Mathematical Transform Library

  • Discrete Wavelet Transform (DWT) - Haar wavelet implementation with efficient block mapping
  • Discrete Cosine Transform (DCT) - Supporting rectangular matrices for flexible block processing
  • Singular Value Decomposition (SVD) - High-precision matrix decomposition using Gonum
  • YUV Color Space Conversion - Optimized batch processing for image color space transformation

Flexible Configuration Options

  • Block Shape Configuration (WithBlockShape) - Customizable processing blocks with automatic validation
  • Watermark Strength Control (WithD1, WithD1D2) - Adjustable robustness vs. noise trade-offs
  • Automatic Parameter Correction - Invalid parameters are automatically adjusted to valid ranges

🔧 Technical Specifications

Supported Image Formats

  • All Go image.Image compatible formats
  • Output as high-quality image.RGBA64 format

Processing Architecture

  • Block-based processing with configurable block sizes (minimum 4x4, even dimensions required)
  • Efficient memory management with row-major slice organization optimized for transform operations
  • Error handling with comprehensive validation for image size constraints

Default Configuration

  • Block Shape: 8x8 pixels
  • Watermark Coefficients: d1=36, d2=20
  • Transform Chain: YUV → Haar DWT → DCT → SVD

📊 Testing & Validation

Comprehensive Test Suite

  • Mathematical accuracy validation against Python reference implementations (PyWavelets, NumPy, OpenCV)
  • Floating-point precision handling with adaptive tolerance strategies
  • Round-trip testing ensuring watermark embedding and extraction consistency
  • Rectangular matrix support validation for all transform operations

Test Coverage

  • DWT Tests: 7 test cases including various matrix sizes and edge cases
  • YUV Tests: Color space conversion accuracy validation
  • DCT Tests: Frequency domain transform verification
  • SVD Tests: Matrix decomposition and reconstruction validation
  • Integration Tests: End-to-end watermarking workflow testing

🚀 Performance Features

Optimization Highlights

  • Concurrent processing across color channels using goroutines
  • Memory-efficient transforms with in-place operations where possible
  • Block mapping optimization for minimal slice manipulation during transforms
  • Batch processing for color space conversions

📋 API Overview

Main API

// Initialize watermark processor
w, err := watermark.New(
    watermark.WithBlockShape(8, 8),
    watermark.WithD1D2(40, 25),
)

// Embed watermark
markedImg, err := w.Embed(ctx, originalImg, bitSequence)

// Extract watermark
extractedBits, err := w.Extract(ctx, markedImg, expectedLength)

Configuration Options

  • WithBlockShape(width, height int) - Set processing block dimensions
  • WithD1(d1 int) - Set single coefficient with lower computational cost
  • WithD1D2(d1, d2 int) - Set dual coefficients for enhanced robustness

🛠️ Dependencies

  • Go 1.24.9+ required
  • gonum.org/v1/gonum v0.16.0 - High-performance numerical computing
  • github.com/stretchr/testify v1.11.1 - Testing framework (dev dependency)

📖 Usage Examples

The package includes comprehensive examples demonstrating:

  • Basic watermark embedding and extraction
  • Custom configuration options
  • Integration with standard Go image processing pipelines

🔒 License & Attribution

This project is licensed under the MIT License. The fundamental signal processing logic draws inspiration from guofei9987/blind_watermark, with appropriate attribution included in THIRD_PARTY_LICENSES.txt.

🚀 Getting Started

go get github.com/yyyoichi/watermark_zero

See the README.md for detailed usage examples and API documentation.


Full Changelog: Initial release - no previous versions to compare against.

Installation: go get github.com/yyyoichi/watermark_zero