Page 1 of 1

detect colors in picture with php

Posted: Thu Feb 01, 2007 5:57 am
by potato
Hi,

i'm working on a image-lybrary in php.
What i'm looking for is to detect the general color tints of an image.
So when theres much black in a picture, i get 000000 for example.
Is it possible to do that?

I've looked at google for it but cant find find any system that works like that. :(

hope anybody can help me...

grretings and a cold beer!

tom

Posted: Thu Feb 01, 2007 7:01 am
by potato
ok, i found this class. Looks perfect, gonna try it now...
http://www.phpclasses.org/browse/package/3370.html

Posted: Thu Feb 01, 2007 9:25 am
by feyd
I think onion2k had some scripts that could do such stuff. They may be floating around here, but are likely on his site.

Posted: Thu Feb 01, 2007 10:57 am
by onion2k
Bevibed.be wrote:ok, i found this class. Looks perfect, gonna try it now...
http://www.phpclasses.org/browse/package/3370.html

Code: Select all

imagecopyresampled($image_resized, $image_orig, 0, 0, 0, 0, $width, $height, $size[0], $size[1]); //WE NEED NEAREST NEIGHBOR RESIZING, BECAUSE IT DOESN'T ALTER THE COLORS
Err.. :? ... that doesn't fill me with confidence.

I wrote a histogram script once. It's on here somewhere. It'll turn up with a search I expect.