m+I>color - Methods to Count the Colors in an Image>j Pair








NAME

6

color - Methods to Count the Colors in an Image






(

SYNOPSIS

s

unsigned long GetNumberColors( const Image *image, FILE *file, ExceptionInfo *exception );

b

unsigned int IsGrayImage( const Image *image, ExceptionInfo *exception );

h

unsigned int IsMonochromeImage( const Image *image, ExceptionInfo *exception );

d

unsigned int IsOpaqueImage( const Image *image, ExceptionInfo *exception );

e

unsigned int IsPaletteImage( const Image *image, ExceptionInfo *exception );

\

unsigned int ListColorInfo( FILE *file, ExceptionInfo *exception );

{

unsigned int QueryColorDatabase( const char *name, PixelPacket *color, ExceptionInfo *exception );

¬

unsigned int QueryColorname( const Image *image, const PixelPacket *color, const ComplianceType compliance, char *name, ExceptionInfo *exception );






B

FUNCTION DESCRIPTIONS





0

GetColorlist

b

Method GetColorList returns any colors that match the specified pattern and color standard.

2

The format of the GetColorList function is:


Q    filelist=GetColorList(const char *pattern,unsigned long *number_colors)
/

A description of each parameter follows:


G
o filelist:


aMethod GetColorList returns a list of colors that match the specified pattern and color standard.


E
o pattern:


:Specifies a pointer to a text string containing a pattern.


Q
o number_colors:


6This integer returns the number of colors in the list.





6

GetNumberColors

N

Method GetNumberColors returns the number of unique colors in an image.

3

The format of the GetNumberColors method is:

ê
unsigned long GetNumberColors ( const Image *image, FILE *file, ExceptionInfo *exception );

A description of each parameter follows.


A
o image:


The image.


?
o file:


@Write a histogram of the color distribution to this file handle.


I
o exception:


0Return any errors or warnings in this structure.





.

IsGrayImage

²
IsGrayImage() returns True if all the pixels in the image have the same red, green, and blue intensities.

The format of the IsGrayImage method is:

Ù
unsigned int IsGrayImage ( const Image *image, ExceptionInfo *exception );

A description of each parameter follows:


C
o status:


VMethod IsGrayImage returns True if the image is grayscale otherwise False is returned.


#
o image:


The image.


'
o exception:


0Return any errors or warnings in this structure.





:

IsMonochromeImage

æ
IsMonochromeImage() returns True if all the pixels in the image have the same red, green, and blue intensities and the intensity is either 0 or MaxRGB.

The format of the IsMonochromeImage method is:

ß
unsigned int IsMonochromeImage ( const Image *image, ExceptionInfo *exception );

A description of each parameter follows:


#
o image:


The image.


'
o exception:


0Return any errors or warnings in this structure.





2

IsOpaqueImage

º
IsOpaqueImage() returns True if none of the pixels in the image have an opacity value other than opaque ( 0 ) .

The format of the IsOpaqueImage method is:

Û
unsigned int IsOpaqueImage ( const Image *image, ExceptionInfo *exception );

A description of each parameter follows:


$
o status:


wMethod IsOpaqueImage returns False if the image has one or more pixels that are transparent otherwise True is returned.


#
o image:


The image.


'
o exception:


0Return any errors or warnings in this structure.





4

IsPaletteImage

h

Method IsPaletteImage returns True if the image is PseudoClass and has 256 unique colors or less.

2

The format of the IsPaletteImage method is:

Ü
unsigned int IsPaletteImage ( const Image *image, ExceptionInfo *exception );

A description of each parameter follows.


$
o status:


XMethod IsPaletteImage returns True is the image is PseudoClass or has 256 color or less.


#
o image:


The image.


'
o exception:


0Return any errors or warnings in this structure.





2

ListColorInfo


ListColorInfo() lists color names to the specified file. Color names are a convenience. Rather than defining a color by its red, green, and blue intensities just use a color name such as white, blue, or yellow.

The format of the ListColorInfo method is:

´
unsigned int ListColorInfo ( FILE *file, ExceptionInfo *exception );

A description of each parameter follows.


"
o file:


%List color names to this file handle.


'
o exception:


0Return any errors or warnings in this structure.





<

QueryColorDatabase

²
QueryColorDatabase() returns the red, green, blue, and opacity intensities for a given color name.

The format of the QueryColorDatabase method is:

ø
unsigned int QueryColorDatabase ( const char *name, PixelPacket *color, ExceptionInfo *exception );

A description of each parameter follows:


?
o name:


+The color name (e.g. white, blue, yellow).


A
o color:


ZThe red, green, blue, and opacity intensities values of the named color in this structure.


'
o exception:


0Return any errors or warnings in this structure.





4

QueryColorname

;
QueryColorname() returns a named color for the given color intensity. If an exact match is not found, a hex value is return instead. For example an intensity of rgb: ( 0, 0, 0 ) returns black whereas rgb: ( 223, 223, 223 ) returns #dfdfdf.

The format of the QueryColorname method is:

H
unsigned int QueryColorname ( const Image *image, const PixelPacket *color, const ComplianceType compliance, char *name, ExceptionInfo *exception );

A description of each parameter follows.


#
o image:


The image.


#
o color:


The color intensities.


K
o Compliance:


0Adhere to this color standard: SVG, X11, or XPM.


"
o name:


#Return the color name or hex value.


'
o exception:


0Return any errors or warnings in this structure.