dcraw messed up highlights

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
olegk
Posts: 37
Joined: 2013-08-16T11:31:10-07:00
Authentication code: 6789

dcraw messed up highlights

Post by olegk »

dcraw in version 7.0.8-7 makes burned-out skies purple in highlight-blend mode.

Camera - Sony Alpha 5100.

The command:
dcraw.exe -v -H 2 -o 1 -q 3 -g 2.4 12.9 -b 1.7 -r 2448.000000 1024.000000 1992.000000 1024.000000 -t 0 DSC00538-00542_l.ARW

As a reference I keep dcraw version compiled from dcraw.c published by David Coffin back in 2016. This one doesn't exhibit such a problem. Screen output from the two dcraw versions is identical - see the textfile in the link below.

Here are the RAW file and two versions of the output - _bad with the new dcraw, _good with the old one.
https://www.dropbox.com/sh/v5n4pw22y8qe ... yUBVa?dl=0


Regards,
Oleg.
olegk
Posts: 37
Joined: 2013-08-16T11:31:10-07:00
Authentication code: 6789

Re: dcraw messed up highlights

Post by olegk »

An addition:
- using -H 1 (unclip) produces the same result
- using -H 0 (clip) produces clipped highlights as expected
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: dcraw messed up highlights

Post by snibgo »

This is an ImageMagick forum. Queries about dcraw should be directed elsewhere. The only patch that IM adds to dcraw is for the "-O" option.

However, in my experience, dcraw v9.27 with "-H 2" doesn't make purple skies.

I have written about dcraw and WB and clipping and contrast.
snibgo's IM pages: im.snibgo.com
olegk
Posts: 37
Joined: 2013-08-16T11:31:10-07:00
Authentication code: 6789

Re: dcraw messed up highlights

Post by olegk »

Sorry if I'm looking "nasty", but the problem is specifically with dcraw included with Imagemagick.

Yesterday I downloaded and compiled dcraw.c from https://www.cybercom.net/~dcoffin/dcraw/ .
The resulting executable works fine.

Regarding the version number - it isn't changed for the last 2 years. The source code is updated (at least became larger), but the version is stuck at 9.27.

I thought David Coffin stopped supporting dcraw, but yesterday I as pleasantly surprised to find newer (larger) source file and newer cameras in the compatibility list.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: dcraw messed up highlights

Post by snibgo »

olegk wrote:Regarding the version number - it isn't changed for the last 2 years.
Ah, I didn't know that. As far as I know, the IM build process downloads dcraw.c, patches it to add "-O", and builds it. It's possible that the IM patch has created the "-H 2" purple sky problem, but it seems more likely that some version (of dcraw v9.27) had that problem, and that's what IM uses. Perhaps IM only downloads dcraw.c when its version number changes.

The development version of IM includes dcraw.c, so diffs could be made with dcraw.c downloaded from Dave Coffin, if someone wanted to trace the problem. Not everyone builds software, and the binary of dcraw provided with IM should work as well binaries from Dave Coffin. Perhaps a developer will take a look.

Personally, I don't use the dcraw provided by IM because (a) IM doesn't give me the control I need through the delegate mechanism and (b) I have a testing process for new versions of software, and I update dcraw independently of IM and (c) I have customised dcraw for my own purposes.
snibgo's IM pages: im.snibgo.com
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: dcraw messed up highlights

Post by dlemstra »

We have switched from dcraw.exe to libraw under Windows. Are you sure you are forcing the use of dcraw.exe instead?
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: dcraw messed up highlights

Post by snibgo »

dcraw.exe is still included with IM Windows binaries, at least for v6.9.9-50.
snibgo's IM pages: im.snibgo.com
User avatar
dlemstra
Posts: 1570
Joined: 2013-05-04T15:28:54-07:00
Authentication code: 6789
Contact:

Re: dcraw messed up highlights

Post by dlemstra »

We still include it because it has some tweaks to make it work with ImageMagick and we added OpenCL support.
.NET + ImageMagick = Magick.NET https://github.com/dlemstra/Magick.NET, @MagickNET, Donate
olegk
Posts: 37
Joined: 2013-08-16T11:31:10-07:00
Authentication code: 6789

Re: dcraw messed up highlights

Post by olegk »

What do you mean under "force"?
I needed the dcraw command line utility with its historical switches; that's why I tried to use it.

Do you say you aren't recommending to use the one supplied with ImageMagick?

Regards,
Oleg.
Post Reply