Easiest way to do this would be to use a database/reference file to store image tags/keywords that are associated with each image file, and simply do a lookup on each search.
downside would be that it would require user input on each image on what criteria each falls under.
Another more difficult way would be to access the image file data itself, and determine what colours are within it, although with many images this would be pretty slow.
I imagine a medium between the two would be the best solution, when the image is originally updated, run it through a program that automatically determines what tags it is to be given, and store them in a file/database for reference use.
I agree with Matt. Flex can't search through a web server directory for anything. Your middleware would have to do this. Check the documentation for whatever software you are using on your web server.
Hi, thank you for your post Matt.
If i have a correct understanding of your answer you would do something like this:
- Read image bitmapdata and calculate how much red, green and blue is in the image.
- store the percentages of red green and blue in the database for reference.
Should I also store the percentages of H, L and S ?
I found H,L and S in the below example of an advanced color picker.. i don't know yet what H,L and S means and what you can do with it..
I am also saving user input on the image..(What color the item on the picture has. 6 different colors by a color picker)
So when the user does a search by color, the script searches the percentage of used color in the picture and then the given color.
This way I don't get pictures of lets say flowers that does not exist in that color.
Would this be the correct way of handling a color search, or would you prefer another/better way?
How would you deal with color ranges?... when is the color still red and not brown or orange?