All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- PNG decoder: 16-bit per-channel images (bitDepth=16) now decode correctly; the pixel stride was
using a fixed 8-bit offset (
x*4,x*3,x) causing pixel-offset corruption in 16-bit RGBA, RGB, and grayscale images - PNG decoder: colorType 4 (grayscale+alpha) images are now supported instead of throwing an "Unsupported PNG color type: 4" error
- PNG decoder: sub-byte grayscale formats (bitDepth 1, 2, 4) now compute the correct scanline byte
length (
ceil(width * bitsPerPixel / 8)) and correctly unpack pixel values from packed bytes; previously the scanline was over-read and raw byte values were used directly as gray values - Pixel-offset corruption in runtime decoders: Fixed buffer offset handling when decoding images
using runtime APIs (ImageDecoder/OffscreenCanvas) in JPEG, WebP, GIF, TIFF, HEIC, and AVIF
formats. Previously, creating
new Uint8Array(imageData.data.buffer)incorrectly assumed pixel data started at offset 0, causing corruption when re-encoding
- PGM format support (Netpbm Portable GrayMap): decode P2 (ASCII) and P5 (binary), encode as P5 binary with luminance-preserving grayscale conversion
- PBM format support (Netpbm Portable BitMap): decode P1 (ASCII) and P4 (binary packed-bit), encode as P4 binary with luminance threshold
- QOI format support (Quite OK Image): full pure-JS encode and decode including all chunk types (INDEX, DIFF, LUMA, RUN, RGB, RGBA)
0.4.3 - 2025-12-28
- Animated GIF encoding with partial frames and transparency: Fixed issues where animated GIFs with partial frames (frames smaller than canvas positioned at offset) produced corrupted output on round-trip encoding. Frame position (left, top) and dimensions are now correctly preserved, alpha channel transparency is properly handled, and disposal methods from input are preserved
0.4.2 - 2025-12-25
- JPEG coefficient extraction and encoding API for steganography support:
Image.extractCoefficients()- Extract quantized DCT coefficients from JPEG imagesImage.encodeFromCoefficients()- Re-encode JPEG from modified coefficientsJPEGFormat.extractCoefficients()- Format-specific coefficient extractionJPEGFormat.encodeFromCoefficients()- Format-specific coefficient encodingJPEGDecodernow supportsextractCoefficientsoption to store quantized valuesJPEGEncoder.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
- Documentation: Added browser support notes to
README.mdanddocs/src/index.mdto clarify in-browser support.
0.4.1 - 2025-12-16
- 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
- CMYK color space support with conversion utilities:
rgbToCmyk()andcmykToRgb()functions for converting individual color valuesrgbaToCmyk()andcmykToRgba()functions for converting entire image data arraysImage.toCMYK()method to convert an image to CMYK representationImage.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: trueencoding option inTIFFEncoderOptionsto save images in CMYK color space- Works with all TIFF compression methods (uncompressed, LZW, PackBits, Deflate)
- PNG encoder now supports
compressionLeveloption (0-9) to control encoding speed vs. file size through adaptive PNG filter selection PNGEncoderOptions,GIFEncoderOptions, andAPNGEncoderOptionstypes exported frommod.tsfor API completeness and consistency- GIF encoder now supports
loopoption to control animation loop count (0 = infinite loop, 1+ = specific count) - Base64 utilities (
encodeBase64,decodeBase64) and data URL helpers (toDataUrl,parseDataUrl) exported frommod.ts
0.4.0 - 2025-12-15
- 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
- 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+OffscreenCanvasfallback for JPEG decoding in environments with canvas APIs available- Comprehensive tests for progressive JPEG decoding in
test/formats/jpeg_progressive.test.ts
- Removed all
console.log,console.warn, andconsole.errorstatements from library code; non-fatal warnings are reported throughImageDecoderOptions.onWarning - Fallback behavior (pure-JS to runtime APIs) is silent by default
Image.decodeandImage.decodeFramesnow acceptImageDecoderOptions(tolerantDecoding,runtimeDecoding,onWarning)Image.encode("jpeg", ...)now honorsqualityandprogressiveviaJPEGEncoderOptions(exported frommod.ts)TIFFEncoderOptionsnow exported frommod.ts(no longer re-exported from the TIFF format module)
- Renamed
*EncodeOptionstypes to*EncoderOptionsfor consistency withImageDecoderOptions ASCIIOptionsremoved; useASCIIEncoderOptions- Encoding APIs (
Image#encode,Image.encodeFrames, andImageFormat.encode*) no longer accept decode options - Per-decoder option types (
JPEGDecoderOptions,GIFDecoderOptions,WebPDecoderOptions) removed in favor ofImageDecoderOptions
0.3.0 - 2025-12-13
- Fault-tolerant decoding modes for GIF, WebP, and JPEG formats
GIFDecoderOptionsinterface withtolerantDecodingoption for frame-level error recoveryWebPDecoderOptionsinterface withtolerantDecodingoption for pixel-level error recoveryJPEGDecoderOptionsnow 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
- JPEG roundtrip encoding now clamps DCT coefficients to valid Huffman table ranges, preventing "Invalid Huffman code" errors when re-encoding decoded JPEGs
- 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
0.2.4 - 2025-12-11
- HEIC format support with runtime-based encode/decode (requires ImageDecoder/OffscreenCanvas API)
- AVIF format support with runtime-based encode/decode (requires ImageDecoder/OffscreenCanvas API)
Image.extractMetadata()static method to extract metadata without decoding pixel data- Metadata extraction support for all formats (PNG, APNG, JPEG, WebP, GIF, TIFF, BMP, ICO, DNG, PAM, PCX, PPM, ASCII, HEIC, AVIF)
- New metadata fields:
format,compression,frameCount,bitDepth,colorType - Enhanced HEIC/AVIF metadata extraction with comprehensive EXIF parsing (19 fields including GPS and camera settings)
- Enhanced WebP metadata with XMP support including camera metadata
- Rotation and flip methods:
rotate(),rotate90(),rotate180(),rotate270(),flipHorizontal(),flipVertical() Image.getSupportedMetadata()method to check which metadata fields are supported per format (now implemented for all 15 formats)- EXIF orientation correction examples in documentation
- CONTRIBUTING.md with development guidelines
- CHANGELOG.md to track version history
- Enhanced npm package metadata with comprehensive keywords
- Node.js engines field in package.json (>=18.0.0)
- Improved .npmignore to exclude test and documentation files
.editorconfigfor consistent coding styles across editors
- Updated all tests to use
test()from@cross/testinstead ofDeno.testfor cross-runtime compatibility - Enhanced documentation with missing API methods (rotation/flip, metadata extraction, resize modes)
- Updated
ResizeOptionsdocumentation to includebicubicmethod andfit/cover/containmodes - Completed
TIFFEncodeOptionsdocumentation withgrayscaleandrgboptions - Updated README and documentation to reflect HEIC/AVIF format support
- Improved EXIF parsing in HEIC and AVIF with safety bounds checks (max 100 entries)
- WebP frame count state management to avoid undefined states
- Cross-runtime test compatibility by replacing
Deno.testwith@cross/test
0.2.3 - 2025-12-10
- Initial release baseline (no changes from 0.2.2, tag creation only)
0.2.2 - 2025-12-10
- Documentation alignment with implemented API
See GitHub Releases for the full history of previous releases.