ImagesDifference

ImagesDifference

Overview

ImagesDifference is a class in Aspose.PDF FOSS for .NET. Inherits from: IDisposable.

Result of a graphical comparison of two rendered PDF pages: the first (source) page rasterised to a 24bpp bitmap, plus a per-pixel record of where the second (destination) page differs from it.

This class provides 3 methods for working with ImagesDifference objects in .NET programs. Available methods include: DifferenceToImage, Dispose, GetDestinationImage. All public members are accessible to any .NET application after installing the Aspose.PDF FOSS for .NET package. Properties: Difference, Height, SourceImage, Stride.

Properties

NameTypeAccessDescription
SourceImageBitmapReadThe first (source) page rendered to a 24bpp RGB bitmap.
Differenceint[]ReadPer-pixel difference record, row-major (index = y * Width + x).
StrideintReadRow stride (in bytes) of SourceImage at 24bpp.
HeightintReadPixel height of the compared images.

Methods

SignatureDescription
GetDestinationImage()Reconstruct the second (destination) page image: identical pixels are copied from the source, differing pixels take their recorded destination colour.
DifferenceToImage(color: Color, backgroundColor: Color)Produce a difference mask: color where the two pages differ and backgroundColor where they are identical.
Dispose()Calls Dispose on this ImagesDifference instance.