Purple haze when converting CR2 into JPG

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
spamathrmrdotnl
Posts: 4
Joined: 2018-10-13T11:56:43-07:00
Authentication code: 1152

Purple haze when converting CR2 into JPG

Post by spamathrmrdotnl »

I upgrade my Canon camera recently to a 77D and the CR2 files I convert into JPG come out with a purple haze: Image

The version string is "ImageMagick 6.8.9-9 Q16 i586 2018-10-03" and version number is "1673".

Anyone any ideas? This did not happen with my older 400D.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Purple haze when converting CR2 into JPG

Post by snibgo »

What is your platform?

Your version of IM is old. Does an upgrade cure the problem?
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Purple haze when converting CR2 into JPG

Post by fmw42 »

Also check your version of JPG

Code: Select all

convert -list format
should show (90) for JPG
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Purple haze when converting CR2 into JPG

Post by fmw42 »

Have you configured your camera to do white balancing? Are all the settings in the camera recorded in the image file meta data?
spamathrmrdotnl
Posts: 4
Joined: 2018-10-13T11:56:43-07:00
Authentication code: 1152

Re: Purple haze when converting CR2 into JPG

Post by spamathrmrdotnl »

To answer your questions:
- I use PHP7 as platform in combination with Debian Jessie.
- The output of 'convert -list format' used to show 62.
- All camera settings are recorded in the file meta data. If you want, I can send you the original CR2.
- I manually compiled/installed the latest ImageMagick from source next to the one that came with Debian Jessie. The output of 'convert -list format' now shows 'libjpeg-turbo 1.3.1'. I used 'convert' to generate a JPG from the CR2. Same result.....
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Purple haze when converting CR2 into JPG

Post by fmw42 »

Please post your original CR2. We can test and see if it is a JPG issue or an Imagemagick issue.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Purple haze when converting CR2 into JPG

Post by snibgo »

There may be a white balance problem. IM uses a delegate to read the raw file, and perhaps IM isn't telling the delegate to do white balance from the camera setting, or the delegate can't read the camera WB setting, or the camera isn't recording the WB, or other possibilities.

What delegate does your IM installation use? dcraw or ufraw-batch?

If you link to a sample CR2, we can advise further.
snibgo's IM pages: im.snibgo.com
spamathrmrdotnl
Posts: 4
Joined: 2018-10-13T11:56:43-07:00
Authentication code: 1152

Re: Purple haze when converting CR2 into JPG

Post by spamathrmrdotnl »

snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Purple haze when converting CR2 into JPG

Post by snibgo »

ImageMagick might call dcraw or ufraw-batch as external delegates, or use libraw internally.

Try a convert with "-verbose". If an external delegate is used, IM will show the command used.

"convert -version" or "magick -version" has a line "Delegates (built-in)". If that includes "raw", then it uses libraw. Otherwise, look in delegates.xml. This will have an entry for either "ufraw-batch" or "dcraw". It might not have the option for setting the white balance.

ufraw 0.19.2 gives me a weird result: light purple, with no shadows. Using "Auto WB" (1.030,1,1.030) instead of "Camera WB" (1.914,1,1.506) gives a more neutral hue, but still far too light. Perhaps ufraw is misreading the file.

Versions of IM on my computer that use libraw give a slightly green cast, but otherwise fine.

dcraw gives a good result, eg:

Code: Select all

%DCRAW%  -v -w -6 -T -O d.tiff IMG_6880.CR2
d.tiff has a fairly neutral tone, with good shadows.

Personally, I read raw images with dcraw directly, not via IM because IM doesn't give me the control that I want.
snibgo's IM pages: im.snibgo.com
spamathrmrdotnl
Posts: 4
Joined: 2018-10-13T11:56:43-07:00
Authentication code: 1152

Re: Purple haze when converting CR2 into JPG

Post by spamathrmrdotnl »

Interesting: I tried using dcraw to convert IMG_6880.CR2 using the same command line - except that mine on Debian is version v9.21 and does not support the -O parameter - and the end result is again the same purple haze.....

Upgraded to dcraw 9.28 (latest) and voila, it works. Thanks for the pointer!
Post Reply