Skip to content

Releases: cross-org/image

v0.4.3

28 Dec 20:29

Choose a tag to compare

Animated GIF Encoding with Partial Frames and Transparency

Fixed animated GIF encoding to properly handle partial frames (frames smaller than canvas at offset positions).

Changes:

  • Frame positions (left, top) are now correctly preserved
  • Frame dimensions use actual frame size instead of canvas size
  • Transparency is properly handled in partial frames
  • Disposal methods (none, background, previous) are preserved on round-trip

Backward Compatible - No breaking changes. Frame metadata is optional with sensible defaults.

v0.4.2

25 Dec 18:37

Choose a tag to compare

Added

  • JPEG coefficient extraction and encoding API for steganography support:
    • Image.extractCoefficients() - Extract quantized DCT coefficients from JPEG images
    • Image.encodeFromCoefficients() - Re-encode JPEG from modified coefficients
    • JPEGFormat.extractCoefficients() - Format-specific coefficient extraction
    • JPEGFormat.encodeFromCoefficients() - Format-specific coefficient encoding
    • JPEGDecoder now supports extractCoefficients option to store quantized values
    • JPEGEncoder.encodeFromCoefficients() - Encode pre-quantized DCT coefficients
    • New types: CoefficientData, JPEGQuantizedCoefficients, JPEGComponentCoefficients
    • Comprehensive tests for coefficient extraction and encoding in
      test/formats/jpeg_coefficients.test.ts

Fixed

  • Documentation: Added browser support notes to README.md and docs/src/index.md to clarify
    in-browser support.

0.4.1

16 Dec 21:17
5178455

Choose a tag to compare

Fixed

  • Documentation: Corrected format support tables to accurately reflect TIFF compression support
    (PackBits and Deflate are pure-JS, not native-only)
  • Documentation: Added missing ICO format to all format support tables in docs/src/formats.md
  • Documentation: Added missing GIF implementation documentation link

Added

  • CMYK color space support with conversion utilities:
    • rgbToCmyk() and cmykToRgb() functions for converting individual color values
    • rgbaToCmyk() and cmykToRgba() functions for converting entire image data arrays
    • Image.toCMYK() method to convert an image to CMYK representation
    • Image.fromCMYK() static method to create an image from CMYK data
  • TIFF CMYK support:
    • Automatic decoding of CMYK TIFFs (photometric interpretation 5) with conversion to RGBA
    • cmyk: true encoding option in TIFFEncoderOptions to save images in CMYK color space
    • Works with all TIFF compression methods (uncompressed, LZW, PackBits, Deflate)
  • PNG encoder now supports compressionLevel option (0-9) to control encoding speed vs. file size
    through adaptive PNG filter selection
  • PNGEncoderOptions, GIFEncoderOptions, and APNGEncoderOptions types exported from mod.ts
    for API completeness and consistency
  • GIF encoder now supports loop option to control animation loop count (0 = infinite loop, 1+ =
    specific count)
  • Base64 utilities (encodeBase64, decodeBase64) and data URL helpers (toDataUrl,
    parseDataUrl) exported from mod.ts

Full Changelog: v0.4.0...v.0.4.1

0.4.0

14 Dec 23:46
c91aa37

Choose a tag to compare

Fixed

  • Progressive JPEG decoding now correctly accumulates DCT coefficients across multiple scans by
    deferring IDCT until all scans complete, fixing issues with half-decoded or corrupted-looking
    progressive images
  • Successive approximation in progressive JPEGs now properly handled: high-bit scans (Ah=0, Al>0)
    and refinement scans (Ah>0) correctly accumulate bit-precision, eliminating blocky/low-resolution
    appearance in images with successive approximation encoding
  • DC predictor now correctly resets at the start of each scan per JPEG specification, preventing
    coefficient accumulation artifacts across scans

Added

  • Progressive JPEG support in pure JavaScript decoder - can now decode both baseline (SOF0) and
    progressive (SOF2) JPEGs without requiring runtime APIs, including full successive approximation
    bit-refinement support
  • createImageBitmap + OffscreenCanvas fallback for JPEG decoding in environments with canvas
    APIs available
  • Comprehensive tests for progressive JPEG decoding in test/formats/jpeg_progressive.test.ts

Changed

  • Removed all console.log, console.warn, and console.error statements from library code;
    non-fatal warnings are reported through ImageDecoderOptions.onWarning
  • Fallback behavior (pure-JS to runtime APIs) is silent by default
  • Image.decode and Image.decodeFrames now accept ImageDecoderOptions (tolerantDecoding,
    runtimeDecoding, onWarning)
  • Image.encode("jpeg", ...) now honors quality and progressive via JPEGEncoderOptions
    (exported from mod.ts)
  • TIFFEncoderOptions now exported from mod.ts (no longer re-exported from the TIFF format
    module)

Breaking

  • Renamed *EncodeOptions types to *EncoderOptions for consistency with ImageDecoderOptions
  • ASCIIOptions removed; use ASCIIEncoderOptions
  • Encoding APIs (Image#encode, Image.encodeFrames, and ImageFormat.encode*) no longer accept
    decode options
  • Per-decoder option types (JPEGDecoderOptions, GIFDecoderOptions, WebPDecoderOptions) removed
    in favor of ImageDecoderOptions

Full Changelog: v0.3.0...v0.4.0

0.3.0

13 Dec 00:55
a2abe27

Choose a tag to compare

[0.3.0] - 2025-12-13

Added

  • Fault-tolerant decoding modes for GIF, WebP, and JPEG formats
  • GIFDecoderOptions interface with tolerantDecoding option for frame-level
    error recovery
  • WebPDecoderOptions interface with tolerantDecoding option for pixel-level
    error recovery
  • JPEGDecoderOptions now exported from main module for advanced usage
  • Comprehensive documentation for fault-tolerant decoding in README.md
  • Tests for fault-tolerant modes in GIF and WebP decoders

Fixed

  • JPEG roundtrip encoding now clamps DCT coefficients to valid Huffman table
    ranges, preventing "Invalid Huffman code" errors when re-encoding decoded
    JPEGs

Performance

  • Optimized JPEG encoder/decoder with typed arrays (Float32Array, Int32Array,
    Uint8Array) for better memory efficiency and performance
  • Optimized WebP encoder/decoder with typed arrays (Uint8Array, Uint32Array) for
    improved performance
  • Reduced memory allocations in hot paths for DCT/IDCT operations
  • Optimized image processing operations with lookup tables and reduced Math
    function calls
  • Optimized resize operations (nearest, bilinear) with bitwise operations and
    pre-computed values
  • Optimized rotation and flip operations using Uint32Array views and batch
    copying
  • Optimized crop operation with row-based batch copying
  • Optimized composite operation by reducing redundant calculations in inner
    loops
  • Optimized Gaussian blur with pre-computed offsets and reduced Math function
    calls

Full Changelog: v0.2.4...v0.3.0

0.2.4

11 Dec 20:54

Choose a tag to compare

What's Changed

  • [WIP] Add metadata extraction for non-decodable images in #60
  • Add HEIC and AVIF format support with metadata extraction in #61
  • Add format, compression, and frame count to metadata extraction in #62
  • [WIP] Ensure HEIC and AVIF have consistent metadata extraction byin #63
  • docs: align documentation with implemented API in #64
  • Add repository improvements: CONTRIBUTING, CHANGELOG, .editorconfig, and enhanced npm package in #65
  • Add getSupportedMetadata to all format handlers in #67

Full Changelog: v0.2.3...v0.2.4

v0.2.3

10 Dec 21:14
e6028cb

Choose a tag to compare

0.2.3