What's the gamma of my JPEG file?

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
splee
Posts: 15
Joined: 2011-07-08T22:21:01-07:00
Authentication code: 8675308

What's the gamma of my JPEG file?

Post by splee »

I have a scanned image (grayscale) and I want to find out the gamma correction value. I read from the ImageMagicK webpage that:
"When processing an image, be aware of the colorspace. Many image processing algorithms assume a linear RGB colorspace. Although you may get satisfactory results processing in the sRGB colorspace, you may get improved results in linear RGB (essentially sRGB with the gamma function removed)."

What does it mean?
I use "identify -verbose myfile.jpg" and it tells me the colorspace is RGB

Basically, I want to:
- find out the gamma-correction value of my JPEG file, and then
- remove the gamma correction


How to do this? Please help.
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: What's the gamma of my JPEG file?

Post by anthony »

Make sure your IM is up to date.

IM v6.7.5 saw IM correctly identify "sRGB" as meaning non-linear RGB, and "RGB" meaning linear RGB.
Before this version the two were swapped.

Note sRGB is not simply RGB with a 'perceptual' gamma correction, though it is close to a linear RGB with a 2.2 gamma correction applied.

See IM Examples, Human Color Perception
http://www.imagemagick.org/Usage/color_ ... perception

And Resize with Colorspace Correction Example (including the 'old example' with a 'red line' indentation)
http://www.imagemagick.org/Usage/resize ... colorspace
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply