THPDFImageRecompressionCostInfo Record
Telemetry of a visual-cost image recompression pass: scanned and candidate counts, per-codec outcomes, trial and rejection counters, quality and error aggregates, and byte savings
Declaration
THPDFImageRecompressionCostInfo= record
ScannedImageCount: Integer;
CandidateImageCount: Integer;
RecompressedImageCount: Integer;
RecompressedJPEGCount: Integer;
RecompressedJPEG2000Count: Integer;
EncodingTrialCount: Integer;
VisualErrorRejectionCount: Integer;
ByteCostRejectionCount: Integer;
SelectedQualitySum: Integer;
MaximumSelectedPerceptualError: Double;
BytesBefore: Int64;
BytesAfter: Int64;
BytesSaved: Int64;
DeterministicSelection: boolean;
end;
Unit
HPDFDoc
Fields
| Field | Purpose |
|---|---|
ScannedImageCount | Images inspected by the pass |
CandidateImageCount | Images that entered the quality search after eligibility checks |
RecompressedImageCount | Images actually re-encoded and written back |
RecompressedJPEGCount | Re-encoded images whose final filter is JPEG |
RecompressedJPEG2000Count | Re-encoded images whose final filter is JPEG 2000 |
EncodingTrialCount | Trial encodings performed while sweeping the quality range |
VisualErrorRejectionCount | Trials rejected because the perceptual error exceeded the budget |
ByteCostRejectionCount | Trials rejected because the byte-cost weight dominated the score |
SelectedQualitySum | Sum of the qualities chosen per recompressed image, for computing an average |
MaximumSelectedPerceptualError | Highest perceptual error among accepted recompressions |
BytesBefore / BytesAfter | Image stream bytes before and after the pass |
BytesSaved | Byte difference achieved; compare with the options' minimum-savings threshold |
DeterministicSelection | true when every reported choice came from the deterministic cost comparison |
Usage notes
- Filled by
THotPDF.OptimizeLoadedImagesByVisualCost; the function result is the number of images recompressed and the record carries the full accounting - Divide
SelectedQualitySumbyRecompressedImageCountto report the average chosen quality - Read
BytesBefore,BytesAfter, andBytesSavedafter the call to verify the pass met the configured savings goal