GMImage.FindColorInColumn
-------------------------

Locates first pixel in the column with given color.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [GraphicsMagick](component_GraphicsMagick.md) | [5.0](newinversion50.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "GMImage.FindColorInColumn"; ImageRef; X; Y; Color { ; Invert; Tolerance } ) 

**MBS**( **"GMImage.FindColorInColumn";** /\* Locates first pixel in the column with given color. \*/  
**$ImageRef**; /\* The image reference number.e.g. 1 \*/   
**$X**; /\* The x coordinate. Zero based from 0 to [GMImage.GetWidth](GMImageGetWidth.md)-1.e.g. 10 \*/   
**$Y**; /\* The y coordinate. Zero based from 0 to [GMImage.GetHeight](GMImageGetHeight.md)-1.e.g. 10 \*/   
**$Color**; /\* A color specification.   
Multiple formats are supported including various color names and # with hex number.  
See FAQ for details.e.g. "RGB 1 0 0" \*/   
**$Invert**; /\* Optional; If 0, we find first pixel matching your color. If 1 we find first pixel not matching the color. Default is 0.e.g. 0 \*/   
**$Tolerance**) /\* Optional; The tolerance for comparison. Normally a small value like 3. So if color is 255, 255, 255 and pixel is 252, 252, 252 we have a match for tolerance being 3.e.g. 3 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| ImageRef | The image reference number. | 1 |  |
| X | The x coordinate. Zero based from 0 to [GMImage.GetWidth](GMImageGetWidth.md)-1. | 10 |  |
| Y | The y coordinate. Zero based from 0 to [GMImage.GetHeight](GMImageGetHeight.md)-1. | 10 |  |
| Color | A color specification.    Multiple formats are supported including various color names and # with hex number.   See [FAQ for details](https://www.monkeybreadsoftware.com/filemaker/faq.shtml#56). | "RGB 1 0 0" |  |
| Invert | If 0, we find first pixel matching your color. If 1 we find first pixel not matching the color. Default is 0. | 0 | Optional |
| Tolerance | The tolerance for comparison. Normally a small value like 3. So if color is 255, 255, 255 and pixel is 252, 252, 252 we have a match for tolerance being 3. | 3 | Optional |

### Result

Returns position or error.

### Description

Locates first pixel in the column with given color.  
You can find first pixel matching your given color in the column starting with given y position and given tolerance. If you set Invert to 1, the plugin returns row for first pixel not matching color.  
Returns -1 if not found.  
### Examples

Finds color in column:

 MBS ("GMImage.FindColorInColumn"; $img ; $x ; $y ; $ColorToSearch ; 1; 3)  
### See also

- [GMImage.FindColorInRow](GMImageFindColorInRow.md)
- [GMImage.GetHeight](GMImageGetHeight.md)
- [GMImage.GetWidth](GMImageGetWidth.md)

### Example Databases

- [GraphicsMagick/Find Pixels](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/GraphicsMagick/Find%20Pixels.shtml#2ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 5.0pr10](https://www.mbsplugins.de/archive/2015-02-06/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 4th February 2015 , last changed 30th June 2026

  
[GMImage.FillPattern](GMImageFillPattern.md) - [GMImage.FindColorInRow](GMImageFindColorInRow.md)

[HTML Version](GMImageFindColorInColumn.shtml)