Skip to content

Conversation

@Pinta365
Copy link
Member

  • JPEG coefficient extraction and encoding API:
    • 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

- Introduced `extractCoefficients` and `encodeFromCoefficients` methods in the `Image` class for handling JPEG quantized DCT coefficients.
- Added `JPEGQuantizedCoefficients` and `JPEGComponentCoefficients` interfaces to define the structure of coefficient data.
- Updated `JPEGDecoder` to support coefficient extraction during decoding.
- Enhanced type definitions in `types.ts` to accommodate new functionality.

This update facilitates advanced image processing and steganography capabilities.
- Implemented `extractCoefficients` in `JPEGFormat` to retrieve quantized DCT coefficients from JPEG data.
- Added `encodeFromCoefficients` method to allow encoding JPEG images from quantized coefficients, enhancing steganography capabilities.
- Introduced type guard `isJPEGCoefficients` to validate coefficient data format.
- Updated `JPEGEncoder` to support encoding directly from pre-quantized coefficients.

These changes improve the functionality for advanced image processing tasks.
@Pinta365 Pinta365 merged commit ae91f10 into main Dec 25, 2025
5 checks passed
@Pinta365 Pinta365 deleted the jpg-coefficient branch December 25, 2025 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants