Incorrect color(whitespace) converting RAW images through LibRaw
Incorrect color(whitespace) converting RAW images through LibRaw
Hey, I am converting some dng images to jpgs, and noticed the color of jpgs are not correct. I'm using the newest version and delegating to LibRaw.
I'm able to get the correct color by using dcraw -W option, which reads the camera whitespace. LibRaw is based on dcraw, and it seems also has a similar option named "use_camera_wb". Is this parameter disabled by default in ImageMagick? Is there any way I can enable it? Or are there some other options? Thanks
I'm able to get the correct color by using dcraw -W option, which reads the camera whitespace. LibRaw is based on dcraw, and it seems also has a similar option named "use_camera_wb". Is this parameter disabled by default in ImageMagick? Is there any way I can enable it? Or are there some other options? Thanks
-
- Posts: 13034
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Incorrect color(whitespace) converting RAW images through LibRaw
I think you mean "-w" (lowercase). Uppercase "-W" disables auto-brighten.qliu wrote:I'm able to get the correct color by using dcraw -W option, which reads the camera whitespace.
No, IM doesn't enable camera white balance with LibRaw. This is a pain.
There are many options that you might want when processing raw images, that IM doesn't allow. Personally, I always process raw images externally, eg with dcraw to create a TIFF, then process that with ImageMagick.
snibgo's IM pages: im.snibgo.com
Re: Incorrect color(whitespace) converting RAW images through LibRaw
Thanks snibgo! I'll just file a ticket to imageMagick, it would be nice to add this option
-
- Posts: 13034
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: Incorrect color(whitespace) converting RAW images through LibRaw
Feel free to file any tickets you want. Personally, I think IM should default to using the camera white balance. However, also remember that IM is a general-purpose system. Sometimes we need more specialist programs, and we can't add zillions of options to IM.
If you want, you can add entries to your delegates.xml. For example, I have:
Then I can run:
If you want, you can add entries to your delegates.xml. For example, I have:
Code: Select all
<delegate decode="linrawv" command="dcraw.exe -v -4 -w -o 0 -T -O "%o" "%i""/>
Code: Select all
magick linrawv:AGA_3443.NEF -auto-level -set colorspace RGB -colorspace sRGB out.tiff
snibgo's IM pages: im.snibgo.com
Re: Incorrect color(whitespace) converting RAW images through LibRaw
Set -define dng:use-camera-wb=true to use the RAW-embedded color profile for Sony cameras. This option requires ImageMagick release 7.0.9-6 or 6.9.10-75. We can add defines for other dcraw options as well. Just let us know which ones you would find useful.
Re: Incorrect color(whitespace) converting RAW images through LibRaw
This option didn't work for me. I'm using this version:
Version: ImageMagick 7.0.9-14 Q16 x86_64 2020-02-06 https://imagemagick.org
I tried these commands on my linux machine:
convert test.dng out2.jpg
convert test.dng -define dng:use-camera-wb=true out1.jpg
However, the out jpgs look the same. The color is different with the original dng image.
Here are the links to the output jpg and original dng:
https://drive.google.com/file/d/1RIAPYU ... sp=sharing
https://drive.google.com/file/d/1iEThhL ... sp=sharing
- fmw42
- Posts: 26383
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Incorrect color(whitespace) converting RAW images through LibRaw
For IM 7, use magick, not convert.
- fmw42
- Posts: 26383
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Incorrect color(whitespace) converting RAW images through LibRaw
Yes, when using IM 7 using convert will invoke IM 6 behavior, which has difference from IM 7
Re: Incorrect color(whitespace) converting RAW images through LibRaw
Thanks for pointing that out. Is this documented somewhere? Are the command-line options and usages remain the same for magick? What are the major differences between convert and magick?
- fmw42
- Posts: 26383
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Incorrect color(whitespace) converting RAW images through LibRaw
There are minor differences. See https://imagemagick.org/script/porting.php#cli
Re: Incorrect color(whitespace) converting RAW images through LibRaw
Do we support -define dng:use-camera-wb=true as a command-line option? I'm using 7.0.9-14 version. I tried but the color is still not correct.
Re: Incorrect color(whitespace) converting RAW images through LibRaw
Its use_camera_wb not use-camera-wb.