Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides   Examples
New in version: 6.3   6.4   6.5   7.0   7.1   7.2   7.3   7.4   7.5   7.6    Statistic  

GMImage.AveragePixelValue

Calculates the average pixel value.

Component Version macOS Windows Server FileMaker Cloud FileMaker iOS SDK
GraphicsMagick 3.0 Yes Yes Yes Yes Yes

MBS( "GMImage.AveragePixelValue"; ImageRef; X; Y; Width; Height )

Parameters

Parameter Description Example value
ImageRef The image reference number. 1
X X-Position of the rectangle. $left
Y Y-Position of the rectangle. $top
Width The width of the rectangle. $width
Height The height of the rectangle. $height

Result

Returns the average pixel value.

Description

Calculates the average pixel value.
Value is in range from 0.0 to 1.0 depending if it is more black (0.0) or white (1.0).
Make sure the pixels are in RGB format before you call this method. (Use GMImage.SetType with value 6.)
This function is designed to test if a certain area in the image is white or black.
Does not check alpha channel!

See also


GMImage.Annotate   -   GMImage.BaseColumns

Feedback: Report problem or ask question.




Links
MBS FileMaker Plugins