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:
- Resize it to a smaller size so that it can be processed faster.
- Quantize it without dithering using my chosen color map.
- Get the photo's histogram to obtain how many times each color appears.
- Store the colors in a database, but I haven't figured out what is the best way to do this for fast retrievals.
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!