I have a pretty big number of photos and a RGB color map (let's say of about 100 colors). How can I group the pictures by color and obtain something like the following: http://labs.ideeinc.com/multicolr ?
My current idea is this: Using ImageMagick, do this for each photo:
Do you know any better and more efficient way to do this? My language of choice is PHP since all the heavy processing will be done by ImageMagick, and the database is PostgreSQL. Thank you in advance!
I notice you already figured out how to get the most relevant colors from the image. Don't resize the images so much because the histogram may look different.
The database may look something like that:
image table:
image_id | image_file
color table:
color_id | color_rgb
image_color table:
image_id | color_id | color_percent
color_percent column will be used for grouping / where clauses
Getting images:
select
image_id
sum(color_percent)/count(color_percent) as relevance
from
image_color
where
color_id IN (175, 243) # the colors you want to involve in this search
and color_percent > 10 # this will drop results with lower significance
group by
image_id
order by
relevance
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With