How to get RGB values using JMagick?

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
ygnhzeus
Posts: 2
Joined: 2012-07-25T09:11:28-07:00
Authentication code: 15

How to get RGB values using JMagick?

Post by ygnhzeus »

I am wondering how I can get RGB values of pixels(JPEG) using JMagick.
getColormap returns null...
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to get RGB values using JMagick?

Post by anthony »

JPEG does not actually store RGB values!!!

It does not even really store color values at all.. What it stores are small 8x8 or 16x16 fourier transforms of the image values in a special colorspace. I forget what colorspace that is at the moment, but it is less sensitive in blues.

The jpeg library decodes those values, typically to either sRGB or CMYK, or some other colorspace as determined by the JPEG's color profile. IM never actually sees the intermedite values, only the decoded (and slightly fuzzy) values that results.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
ygnhzeus
Posts: 2
Joined: 2012-07-25T09:11:28-07:00
Authentication code: 15

Re: How to get RGB values using JMagick?

Post by ygnhzeus »

Well, is there any way to get the RGB value of Jpeg by JMagick?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: How to get RGB values using JMagick?

Post by anthony »

generally read it in and output the image using txt: (enumerated pixel format)
See http://www.imagemagick.org/Usage/files/#txt
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply