Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jan 2007
    Thanked 0 Times in 0 Posts

    Hex Code to Image

    Hi guys. Any ideas on how I can get this lookup to work..:?

    I'm using a app that uploads an image and returns a hex code in a 3x3 grid. (See here: http://jrm.cc/color-palette-generator)

    I want to take this one stage further and have a code that will then take the Hex code and look up a field in an sql database containing hex codes. Then convert the hex code into an image containing the selected colour. For example;

    User uploads image of the sky
    App returns hex codes of sky
    App then needs to look in a field database of images on server and finds image/s with similar hex value
    App then returns images in replace of the hex code (i.e blue water, swimming pool, blue coloured hat etc etc)

    Any thoughts on how to acheive this?


  2. #2
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Vancouver, BC Canada
    Thanked 100 Times in 100 Posts
    Study the PHP image functions. imagecolorexact might be what you are looking for to get started. You would run all images through a loop and output the ones that match the uploaded image.


    Last edited by Len Whistler; 05-01-2009 at 10:35 PM.
    Leonard Whistler


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts