LibGd 2.4.0-dev
GD Graphics library
Loading...
Searching...
No Matches
Data Structures | Macros | Enumerations | Functions
Image Comparison

Data Structures

struct  gdImagePerceptualDiffOptions
 Options for perceptual image comparison. More...
 
struct  gdImagePerceptualDiffResult
 Result of perceptual image comparison. More...
 

Macros

#define GD_CMP_IMAGE   1
 
#define GD_CMP_NUM_COLORS   2
 
#define GD_CMP_COLOR   4
 
#define GD_CMP_SIZE_X   8
 
#define GD_CMP_SIZE_Y   16
 
#define GD_CMP_TRANSPARENT   32
 
#define GD_CMP_BACKGROUND   64
 
#define GD_CMP_INTERLACE   128
 
#define GD_CMP_TRUECOLOR   256
 

Enumerations

enum  gdImageDiffMode { GD_IMAGE_DIFF_NONE , GD_IMAGE_DIFF_OVERLAY , GD_IMAGE_DIFF_MASK }
 Options for perceptual image comparison mode. More...
 

Functions

int gdImageCompare (gdImagePtr im1, gdImagePtr im2)
 Compare two images.
 

Detailed Description

Macro Definition Documentation

◆ GD_CMP_BACKGROUND

#define GD_CMP_BACKGROUND   64

Background color differs

◆ GD_CMP_COLOR

#define GD_CMP_COLOR   4

Image colors differ

◆ GD_CMP_IMAGE

#define GD_CMP_IMAGE   1

Actual image IS different

◆ GD_CMP_INTERLACE

#define GD_CMP_INTERLACE   128

Interlaced setting differs

◆ GD_CMP_NUM_COLORS

#define GD_CMP_NUM_COLORS   2

Number of colors in pallette differ

◆ GD_CMP_SIZE_X

#define GD_CMP_SIZE_X   8

Image width differs

◆ GD_CMP_SIZE_Y

#define GD_CMP_SIZE_Y   16

Image heights differ

◆ GD_CMP_TRANSPARENT

#define GD_CMP_TRANSPARENT   32

Transparent color differs

◆ GD_CMP_TRUECOLOR

#define GD_CMP_TRUECOLOR   256

Truecolor vs palette differs

Enumeration Type Documentation

◆ gdImageDiffMode

Options for perceptual image comparison mode.

Enumerator
GD_IMAGE_DIFF_NONE 

No difference

GD_IMAGE_DIFF_OVERLAY 

Overlay difference

GD_IMAGE_DIFF_MASK 

Mask difference

Function Documentation

◆ gdImageCompare()

int gdImageCompare ( gdImagePtr  im1,
gdImagePtr  im2 
)

Compare two images.

compare two images and some of its attributes. The images must be of the same size, otherwise the function will return -1. For accurate image content comparison, use gdImagePerceptualDiff instead.

Parameters
im1An image.
im2Another image.
Returns
A bitmask of <Image Comparison> flags where each set flag signals which attributes of the images are different.

< Interlaced setting differs

< Transparent color differs

< Truecolor vs palette differs

< Image width differs

< Actual image IS different

< Image heights differ

< Actual image IS different

< Number of colors in pallette differ

< Image colors differ

< Actual image IS different

< Image colors differ

< Actual image IS different

< Image colors differ

< Actual image IS different

< Image colors differ