JPEG2000 Image Format Support

Overview

HotPDF now provides comprehensive support for JPEG2000 image formats, including JP2, J2K, and JPT files. JPEG2000 is a wavelet-based image compression standard that provides superior compression efficiency and quality compared to traditional JPEG format.

Supported Formats

  • JP2: JPEG2000 Part 1 format with complete file structure
  • J2K: JPEG2000 codestream format (raw compressed data)
  • JPT: JPEG2000 Part 9 JPIP (JPEG2000 Interactive Protocol) format

Key Features

  • Automatic format detection and appropriate processing
  • Support for both lossless and lossy compression
  • Multi-component image support (RGB, RGBA, Grayscale)
  • Advanced bit-depth support (8, 12, 16 bits per component)
  • Progressive decoding capabilities
  • Memory-efficient processing for large images

Usage Example


// Delphi example - Adding JPEG2000 image to PDF
procedure AddJPEG2000Image;
var
  PDF: THotPDF;
begin
  PDF := THotPDF.Create(nil);
  try
    PDF.FileName := 'output.pdf';
    PDF.BeginDoc;
    PDF.AddPage;

    // Add JPEG2000 image - format is automatically detected
    PDF.AddImage('sample.jp2', 100, 100, 200, 150);

    // J2K codestream format is also supported
    PDF.AddImage('sample.j2k', 100, 300, 200, 150);

    PDF.EndDoc;
  finally
    PDF.Free;
  end;
end;
        

Technical Implementation

The JPEG2000 support is implemented through the HPDFJpeg2000.pas unit, which provides:

  • THPDFJpeg2000Decoder: Main decoder class for processing JPEG2000 images
  • Format Detection: Automatic identification of JP2, J2K, and JPT formats
  • Stream Processing: Support for both file and stream-based image loading
  • OpenJPEG Integration: Framework for advanced processing using OpenJPEG library

Performance Benefits

  • Better compression ratios than traditional JPEG
  • No blocking artifacts at high compression rates
  • Progressive transmission and viewing
  • Region of interest (ROI) encoding support
  • Lossless compression option

Compatibility

JPEG2000 support is available in both 32-bit and 64-bit versions of HotPDF and is compatible with all supported Delphi and C++ Builder versions.

See Also