Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
GMImage.AveragePixelValue
Calculates the average pixel value.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
GraphicsMagick | 3.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "GMImage.AveragePixelValue"; ImageRef { ; X; Y; Width; Height } ) More
Parameters
Parameter | Description | Example | Flags |
---|---|---|---|
ImageRef | The image reference number. | 1 | |
X | X-Position of the rectangle. | $left | Optional |
Y | Y-Position of the rectangle. | $top | Optional |
Width | The width of the rectangle. Default is width of image. |
$width | Optional |
Height | The height of the rectangle. Default is height of image. |
$height | Optional |
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!
Version 9.1 and later uses full image if rectangle is missed.
See also
Release notes
- Version 11.2
- Fixed GMImage.AveragePixelValue to run with only 2 parameters.
- Version 9.1
- Changed GMImage.AveragePixelValue to make rectangle optional.
Example Databases
Blog Entries
- GraphicsMagick in FileMaker, part 9
- MBS FileMaker Plugin, version 11.2pr8
- Create PDF from scanned images and skip blank pages
- MBS FileMaker Plugin, version 9.1pr4
- MBS Filemaker Plugin, version 3.0pr10
This function checks for a license.
Created 18th August 2014, last changed 18th February 2019