I understand that JPG file (sRGB) are corrected for gamma (2.2 if I am not wrong).
How do I "de-gamma" it? i.e. remove the gamma correction, using command line option?
Gamma correction for JPG file
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Gamma correction for JPG file
try converting it to a linear color colorspace, RGB or use -gamma 1/2.2 = 0.454545
convert image.jpg -colorspace RGB newimage.jpg
convert image.jpg -gamma 0.454545 newimage.jpg
convert image.jpg -colorspace RGB newimage.jpg
convert image.jpg -gamma 0.454545 newimage.jpg
Re: Gamma correction for JPG file
I tried "convert image.jpg -gamma 0.454545 newimage.jpg" but it gave me the following error:
"Insufficient memory (case 4) newimage.jpg @ error/jpeg.c/JPEGErrorHandler/296"
Then I tried this "convert -limit memory 1 -limit map 1 image.jpg -gamma 0.454545 newimage.jpg" but it gave me the following error:
"unable to extend cache 'image.jpg': No space left on device @ error/cache.c/OpenPixelCache/4139"
"Application transferred too few scanlines image.jpg @ warning/jpeg.c/JPEGErrorHandler/293"
...
What else can I do?
I am using WinXP command line option. The file size is 50MB
"Insufficient memory (case 4) newimage.jpg @ error/jpeg.c/JPEGErrorHandler/296"
Then I tried this "convert -limit memory 1 -limit map 1 image.jpg -gamma 0.454545 newimage.jpg" but it gave me the following error:
"unable to extend cache 'image.jpg': No space left on device @ error/cache.c/OpenPixelCache/4139"
"Application transferred too few scanlines image.jpg @ warning/jpeg.c/JPEGErrorHandler/293"
...
What else can I do?
I am using WinXP command line option. The file size is 50MB
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Gamma correction for JPG file
Sounds to me like your computer has no disk space available!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Gamma correction for JPG file
oh yes "convert -limit memory 1 -limit map 1 image.jpg -gamma 0.454545 newimage.jpg" works after I freed some harddisk space.
However "convert image.jpg -gamma 0.454545 newimage.jpg" still fails. Must I use the "-limit memory 1 -limit map 1" all the time? What is this option doing actually?
However "convert image.jpg -gamma 0.454545 newimage.jpg" still fails. Must I use the "-limit memory 1 -limit map 1" all the time? What is this option doing actually?
- anthony
- Posts: 8883
- Joined: 2004-05-31T19:27:03-07:00
- Authentication code: 8675308
- Location: Brisbane, Australia
Re: Gamma correction for JPG file
Forcing the use of temporary disk for image data cache, rather than memory, though that switch should be reasonably automatic.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
https://imagemagick.org/Usage/
Re: Gamma correction for JPG file
Hi Anthony,
I want the so called "raw" image pixel, ie. with the gamma effect removed.
Are you sure it is "-gamma 0.454545", not "-gamma 2.2"?
I am confused.
Could you please help?
Thanks...
I want the so called "raw" image pixel, ie. with the gamma effect removed.
Are you sure it is "-gamma 0.454545", not "-gamma 2.2"?
I am confused.
Could you please help?
Thanks...
Re: Gamma correction for JPG file
Why not "-colorspace RGB". It converts your image to linear RGB for further operations.
sRGB is very similar to gamma 2.2, but not exactly the same. Not sure about AdobeRGB (some DC produces AdobeRGB instead of sRGB).
sRGB is very similar to gamma 2.2, but not exactly the same. Not sure about AdobeRGB (some DC produces AdobeRGB instead of sRGB).