Releases: cross-org/image
Releases · cross-org/image
v0.4.3
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
Added
- 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
Fixed
- Documentation: Added browser support notes to
README.mdanddocs/src/index.mdto clarify
in-browser support.
0.4.1
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()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.ts
for 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
Full Changelog: v0.4.0...v.0.4.1
0.4.0
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+OffscreenCanvasfallback 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, 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)
Breaking
- 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
Full Changelog: v0.3.0...v0.4.0
0.3.0
[0.3.0] - 2025-12-13
Added
- 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
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
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