Getting most prominent colour
-
- Posts: 1
- Joined: 2013-02-22T13:27:11-07:00
- Authentication code: 6789
Getting most prominent colour
I have images of e-commerce products (shirts, skirt, jeans) and I want to find the colour of the product - so ignore the background, pretty face etc. Just focus on the product. How can this be done with some degree of reliability?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Getting most prominent colour
What file format? What version of IM are you using and what platform?
The main idea would be to reduce colors if needed depending upon format and get the top entries from the histogram. But the background may have a larger count than the shirt color depending upon how much background.
See
http://www.imagemagick.org/Usage/files/#histogram
The main idea would be to reduce colors if needed depending upon format and get the top entries from the histogram. But the background may have a larger count than the shirt color depending upon how much background.
See
http://www.imagemagick.org/Usage/files/#histogram
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Getting most prominent colour
You need to work out what, visually, distinguishes the product from everything else. Is it always in the centre of the image? Is it the most common colour? Is the background constant for all the images?
You also need to decide what you want reported. Is a primary colour (like red, green, blue, cyan, magenta, yellow) sufficient?
You also need to decide what you want reported. Is a primary colour (like red, green, blue, cyan, magenta, yellow) sufficient?
snibgo's IM pages: im.snibgo.com