Nikon D750 .nef raw conver

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?".
jan.stritesky
Posts: 7
Joined: 2019-03-12T15:10:05-07:00
Authentication code: 1152

Nikon D750 .nef raw conver

Post by jan.stritesky »

Hi all,
I apologize for starting a new topic about nef convert. I'm new to IM. I found a similar topic on the forum but they did not help to me.

I would like to convert raw nef file from Nikon D750 camera (to tiff or jpeg) but output is darker and yellower against Photoshop output.
I found the problem will probably be related to AWB, but I don't know how to achieve the same result as PS.
I used simple

Code: Select all

magic convert in.nef out.jpg 
I also tryed to use

Code: Select all

dcraw.exe dcraw -6 -w -T -O out.tiff in.nef
the result is much better (almost like PS), but I want to use IM directly.
I tryed to modify

Code: Select all

dng:decode
record in delegates.xml, but this has no effect

link to sample file: https://img.photographyblog.com/reviews ... 750_05.nef
IM output: https://ibb.co/vvdzzZp
PS output: https://ibb.co/YLDD3SN

I'm running on Win 10, ImageMagick-7.0.8-33-Q16-x64-static/ddl.


Thank you for your advice.
Regards
Jan
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Nikon D750 .nef raw conver

Post by snibgo »

What does "magick -version" say? For example:

Code: Select all

f:\web\im>%IMG7%magick -version
Version: ImageMagick 7.0.7-28 Q16 x64 2018-03-25 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Visual C++: 180040629
Features: Cipher DPC HDRI Modules OpenMP
Delegates (built-in): bzlib cairo flif freetype gslib heic jng jp2 jpeg lcms lq
 openexr pangocairo png ps raw  <<== rsvg tiff webp xml zlib
My version has a built-in delegate "raw", so an external delegate is not used, so changing delegates.xml will have no effect (sadly).

This means IM offers the user no controls over converting raw files. Personally, I use dcraw instead.

EDIT: I should add: If you want, you can create an entry in delegates.xml with a different prefix, eg "MYRAW:", and use that to call dcraw (or any other command-line raw converter).
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: Nikon D750 .nef raw conver

Post by fmw42 »

Use magick not magic.

So if you do what snibgo said the command would be:

Code: Select all

magick MYRAW:convert in.nef out.jpg 
But you have to set up the entry for MYRAW in your delegates.xml file to use the same arguments as you would when using dcraw so that it will do the AWB for you.
jan.stritesky
Posts: 7
Joined: 2019-03-12T15:10:05-07:00
Authentication code: 1152

Re: Nikon D750 .nef raw conver

Post by jan.stritesky »

Thanks a lot:

Code: Select all

<delegate decode="MYRAW" stealth="True" command="dcraw.exe -6 -w -T -O &quot;%o&quot; &quot;%i&quot;"/>
Works for me.
JS
jan.stritesky
Posts: 7
Joined: 2019-03-12T15:10:05-07:00
Authentication code: 1152

Re: Nikon D750 .nef raw conver

Post by jan.stritesky »

Is there a dcraw setting that would give the same result as provides Adobe Camera Raw with As Shot and Default settings?
For this picture https://bit.ly/2HBlSiD, is dcraw output cyan and blured, but Camera Raw provide colour-neutral sharp image.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Nikon D750 .nef raw conver

Post by snibgo »

dcraw can neither blur nor sharpen. If your result from Adobe Camera Raw is sharper, then that is applying sharpening.
snibgo's IM pages: im.snibgo.com
jan.stritesky
Posts: 7
Joined: 2019-03-12T15:10:05-07:00
Authentication code: 1152

Re: Nikon D750 .nef raw conver

Post by jan.stritesky »

Sharpness is perhaps a secondary problem.
Output from dcraw is cyan and have resolutin 6032x4032px - http://bit.do/eL3PC
Output from other aplications (Capture NX-D, Adobe CR, online converters...) have neutral color and output resolution is 6016x4016px http://bit.do/eL3RF
I'm confused.
- is in the nef raw file included some preview jpg?
- I tried to use nikon icm profile - no resut
- alos set custom white balance by -r option
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Nikon D750 .nef raw conver

Post by snibgo »

jan.stritesky wrote:Output from dcraw is...
What was your command? What options did you specify for white balance? Type "dcraw" for a list of the options.
snibgo's IM pages: im.snibgo.com
jan.stritesky
Posts: 7
Joined: 2019-03-12T15:10:05-07:00
Authentication code: 1152

Re: Nikon D750 .nef raw conver

Post by jan.stritesky »

I tried multiple commands:
i start from this dcraw.exe -6 -w -T -O -> - w for auto white balance
by dcraw -i -v i get Camera multipliers, which i tried to use as custom wb value:
dcraw.exe -6 -o 1 -A 1.222656 1.000000 2.179688 0.000000 -T -O
I also try shift gamma by: -g 2.4 12.9.
Only one thing that helps a bit is the shift in brightness by -b 1.4, but why this value?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Nikon D750 .nef raw conver

Post by snibgo »

Code: Select all

dcraw -w -6 -T -O x.tiff test.nef
... works fine for a sRGB output, automatically brightened.

Your "-A" option is wrong, as "-A" uses whatever WB makes your specified coordinates gray. Perhaps you really meant "-r" with those numbers, but why set the second G channel multiplier to zero?
snibgo's IM pages: im.snibgo.com
jan.stritesky
Posts: 7
Joined: 2019-03-12T15:10:05-07:00
Authentication code: 1152

Re: Nikon D750 .nef raw conver

Post by jan.stritesky »

No output is still same - to cyan against another apps output.
I tried use "-A" and also "-r" with RGBG numbers. I use zero for second G because on the output fom "dcraw -i -v" is zero for this channel. I also tried to use value from first G channel but it has no effect.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Nikon D750 .nef raw conver

Post by snibgo »

You should generally use the same multiplier for both green channels.

other.tiff has certainly been sharpened. If you zoom in to dark/light boundaries, you can see the overshoot ("acutance"). I suspect other "prettifying" has been applied: it is lighter and more saturated than dcraw.tif.
snibgo's IM pages: im.snibgo.com
jan.stritesky
Posts: 7
Joined: 2019-03-12T15:10:05-07:00
Authentication code: 1152

Re: Nikon D750 .nef raw conver

Post by jan.stritesky »

We used custom color temperature 2900K during take the test photo. Is it a problem?
All other preview and convert application using "prettifying" filter?
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Nikon D750 .nef raw conver

Post by snibgo »

If you know your lighting is 2900K, and your camera was set to that, that should be good. However, the lighting might be nominally 2900K but actually slightly different.

If the "white" of your background should be a neutral gray, then you can tell the raw converter to use the WB that makes that gray. This may be more accurate than assuming your lighting is 2900K.

Your questions are about the different capabilities of different raw converters. I suggest you look at the forum https://discuss.pixls.us/ , where people have more knowledge than me of raw converters.
snibgo's IM pages: im.snibgo.com
User avatar
whugemann
Posts: 289
Joined: 2011-03-28T07:11:31-07:00
Authentication code: 8675308
Location: Münster, Germany 52°N,7.6°E

Re: Nikon D750 .nef raw conver

Post by whugemann »

I have a similar problem under Windows 10, 64 bit:
I would like to develop a Sony RAW photo (*.arw) with my own settings and apply a lens correction to it. Following the hint given in this thread I arrived at:

Code: Select all

  <delegate decode="LUMINANCE" stealth="True" command="dcraw.exe -q 3 -o 0 -4 -r 1 1 1 1 -S 65535 -T -O &quot;%o&quot; &quot;%i&quot;"/>
which correctly performs the conversion based on dcraw and the parameters supplied.

But in order to apply the correction for barrel distortion, I need to generate a temporary file in order to to process it further. Therefore I tried using %u.tif

Code: Select all

  <delegate decode="LUMINANCE" stealth="True" command="dcraw.exe -q 3 -o 0 -4 -r 1 1 1 1 -S 65535 -T -O &quot;%u.tif&quot; &quot;%i&quot;"/>
following the "fake" code entry for DNG. Thise results in the message:

Code: Select all

magick: unable to open image 'C:/Users/Hugemann/AppData/Local/Temp/magick-14944A1WfII0P63C7': No such file or directory @ error/blob.c/OpenBlob/3491.
magick: unable to open module file 'C:\Program Files\ImageMagick7\modules\coders\IM_MOD_RL_LUMINANCE_.dll': No such file or directory @ warning/module.c/GetMagickModulePath/675.
magick: unable to open file 'C:/Users/Hugemann/AppData/Local/Temp/magick-14944A1WfII0P63C7': No such file or directory @ error/constitute.c/ReadImage/596.
which is formally correct, as the conversion first creates four temporary files

Code: Select all

magick-14944A1Wfll0P63C7         0 KB
magick-14944Aqa2f1WU-190    20.388 KB
magick-14944CyfoUhctpi9O         0 KB
magick-14944zwjvGbkYIUli         0 KB
and stores the result in magick-14944CyfoUhctpi9O.tif.

What goes wrong here?

BTW: I took me quite a while to find out that the delegates-entry for dng:decode is simply ignored. This is very misleading. It should be deleted in future releases.
Wolfgang Hugemann
Post Reply