Getting RGB for an Image, CMD or PHP

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
lookbadgers
Posts: 1
Joined: 2012-01-23T05:04:37-07:00
Authentication code: 8675308

Getting RGB for an Image, CMD or PHP

Post by lookbadgers »

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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Getting RGB for an Image, CMD or PHP

Post by fmw42 »

what colorspace is your original image? can you post a link to it? profiles is the proper way to convert for color accuracy. see http://www.imagemagick.org/Usage/formats/#profiles
Post Reply