Skip to main content

My goal is to identify the dominant color in a JPG. For instance, your JPG is mostly 'green'; that is, most of the JPG pixels fall somewhere in the 'green' hue. I've looked into using a Python script, but unfortunately my Python skills are limited so that option has been troublesome.

I've also tried the 'RasterCellNeighborSummer', custom transformer but I don't get any output. I've attached a basic workspace that just feeds in a test JPG to the 'RasterCellNeighborSummer' transformer.

Hi @jamiefoutz, sorry, there seems to be a bug in the RasterCellNeighborSummer transformer.

The RasterConvolver transformer has been newly introduced in FME 2018.1. Try this one if you are using the latest version of FME.


Hi @jamiefoutz,

Another option might be to explore the RasterExpressionEvaluator using conditional statements. This article might help you get started: https://knowledge.safe.com/articles/1226/using-conditions-with-the-rasterexpressionevaluato.html


This is an interesting challenge. Attached is a custom transformer that returns the Hue in degrees of the most commonly occurring colour, within a tolerance range. It is unfortunately locked as it leverages some custom transformers I'm not allowed to share publicly. The description includes an overview of the methodology.

 

mainimagehue.fmx