Getting RGB for an Image, CMD or PHP
Posted: 2012-01-23T05:36:14-07:00
I'm working on comparing images but having problems setting the output to be RGB.
'convert image.jpg -strip -normalize -resize 4x4! +profile "*" -colorspace sRGB output.png'
I've tried profile instead of colour space '-profile "C:\ImageMagick\sRGB_v4_ICC_preference.icc"'
Which is correct?
The idea is to resize an image to 4x4 then get the RGB values for it, I'm expecting to get 48 numbers between 0 and 255, I get about 333 numbers.
4*4*3 = 48
Width*Height*(R+G+B) = 48
I guess this is because when I read the image with PHP it's reading the headers and other file bits not just the image section, how can I do this?
Thanks for reading.
Using Windows and PHP.
'convert image.jpg -strip -normalize -resize 4x4! +profile "*" -colorspace sRGB output.png'
I've tried profile instead of colour space '-profile "C:\ImageMagick\sRGB_v4_ICC_preference.icc"'
Which is correct?
The idea is to resize an image to 4x4 then get the RGB values for it, I'm expecting to get 48 numbers between 0 and 255, I get about 333 numbers.
4*4*3 = 48
Width*Height*(R+G+B) = 48
I guess this is because when I read the image with PHP it's reading the headers and other file bits not just the image section, how can I do this?
Thanks for reading.
Using Windows and PHP.