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

MaxHashDistanceMaximum 64-bit difference-hash Hamming distance from 0 to 7
MaxMeanErrorMaximum mean decoded sample-channel error from 0 to 255
MaxChannelErrorMaximum decoded error for one sampled channel from 0 to 255
ReportReceives 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

thresholdsThe requested hashDistance, meanError, and channelError limits
imagesScannedEligible indirect image streams examined
imagesDecodedImages decoded into the fixed comparison sample
decodeFailuresImages skipped because their pixels could not be decoded
canonicalImagesDistinct accepted canonical groups
hashCandidatesPreviously retained images sharing at least one difference-hash band
candidateComparisonsPairs that passed semantic and hash-distance gates and reached sample confirmation
imagesDeduplicatedImages accepted as perceptual duplicates
referencesRepointedReferences that a live operation would redirect
reclaimableBytesEncoded payload bytes belonging to accepted duplicate streams
samplesComparedColour-channel sample values examined during confirmation
maxAcceptedHashDistanceLargest accepted hash distance
maxAcceptedMeanErrorLargest accepted mean absolute channel error
maxAcceptedChannelErrorLargest 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