4 Replies Latest reply on Jun 27, 2010 12:01 PM by Starlover_jacob

    image search by color

    Starlover_jacob Level 1

      Hi there,


      I see on the net some neat image search sites that can search by color.



      My question;

      - How does this work?

      - Can this be done in actionscript? (Flex or air)

      - What do i need for this to work?


      for example i have a directory on my server with a lot of images in it.

      Now i want to use the neat color search to get me only the images with lets say the color red in it.


      Please let me know what's the best way to acheive this.


      Greets, J.

        • 1. Re: image search by color
          Starlover_jacob Level 1

          Anyone ideas?

          • 2. Re: image search by color
            Matt Le Fevre Level 4

            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.

            • 3. Re: image search by color
              rtalton Level 4

              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.

              • 4. Re: image search by color
                Starlover_jacob Level 1

                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?


                Greets, J.