GetSimilarImageDeduplicationReportJSON
Image handling, Optimisation, Diagnostics
Description
Runs a read-only perceptual image deduplication analysis with the supplied thresholds and writes its work, accepted-error, and estimated payload-saving metrics as JSON
Syntax
Function TPDFlib.GetSimilarImageDeduplicationReportJSON(
MaxHashDistance, MaxMeanError, MaxChannelError: Integer;
Out Report: WideString): Integer;
Parameters
| MaxHashDistance | Maximum 64-bit difference-hash Hamming distance from 0 to 7 |
|---|---|
| MaxMeanError | Maximum mean decoded sample-channel error from 0 to 255 |
| MaxChannelError | Maximum decoded error for one sampled channel from 0 to 255 |
| Report | Receives the JSON document |
Return values
Returns the number of similar image objects that the dry run would consolidate, or 0 when no pair is accepted or the request is invalid
JSON fields
| thresholds | The requested hashDistance, meanError, and channelError limits |
|---|---|
| imagesScanned | Eligible indirect image streams examined |
| imagesDecoded | Images decoded into the fixed comparison sample |
| decodeFailures | Images skipped because their pixels could not be decoded |
| canonicalImages | Distinct accepted canonical groups |
| hashCandidates | Previously retained images sharing at least one difference-hash band |
| candidateComparisons | Pairs that passed semantic and hash-distance gates and reached sample confirmation |
| imagesDeduplicated | Images accepted as perceptual duplicates |
| referencesRepointed | References that a live operation would redirect |
| reclaimableBytes | Encoded payload bytes belonging to accepted duplicate streams |
| samplesCompared | Colour-channel sample values examined during confirmation |
| maxAcceptedHashDistance | Largest accepted hash distance |
| maxAcceptedMeanError | Largest accepted mean absolute channel error |
| maxAcceptedChannelError | Largest accepted individual channel error |
Remarks
The method never rewrites references or removes objects
The report estimates encoded stream payload savings and excludes indirect-object, dictionary, cross-reference, and container overhead
Review the accepted maximum errors and resulting document visually before applying permissive thresholds
See also
DeduplicateSimilarImages, TPDFlibImageSimilarityDedupStats, GetImageDeduplicationReportJSON