Generate colour palette from uploaded image

Posted by greenie on Stack Overflow See other posts from Stack Overflow or by greenie
Published on 2010-04-12T13:40:41Z Indexed on 2010/04/12 13:43 UTC
Read the original article Hit count: 324

Filed under:
|

Just for fun I've been looking at how to use the GD library to create a colour palette from an image. So far I've used GD to resize a user uploaded image to an appropriate size for displaying on a webpage.

Now I'd like to be able to get about five or so different colours from the image that represent the range of colours present in it. Once I've done that I'd like to generate a complementary palette based upon those colours, which I can then use to colour different elements on the page.

Any help I can get about how I would find the initial colour palette would be much appreciated!

© Stack Overflow or respective owner

Related posts about php

Related posts about gd