Page 1 of 2
Latest IM ignores delegates?
Posted: 2018-02-08T14:16:19-07:00
by ravengangrel
Hello,
I'm trying to convert some DNG files to JPG, but they appear with a yellowish tone.
Trying manually my custom delegate (a call to ufraw-batch in windows) and then converting the generated png to jpg with convert, everything works right.
Finally, I have removed ufraw-batch.exe from the path, but the conversion still works, even trying to force the delegate prepending "dng:" before the source file name. It's like the delegates.xml file is being ignored. Is that possible?
Is there something I can do?
Thank you very much.
Re: Latest IM ignores delegates?
Posted: 2018-02-08T14:24:13-07:00
by ravengangrel
And with "delegates" I mean the old delegates.xml file. Is it still used?
I have found that removing IM_MOD_RL_dng_.dll from modules/coders it doesn't work, but still doesn't use the old delegates.xml
Re: Latest IM ignores delegates?
Posted: 2018-02-08T14:28:23-07:00
by fmw42
What is your IM version? I presume you are on Windows from your comments. What was your exact command line and how and where did you modify the delegates.xml file? Can you post your input and output images so we can test with them? Please explain what is wrong with the output you post.
See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at
http://www.imagemagick.org/discourse-se ... f=1&t=9620
Re: Latest IM ignores delegates?
Posted: 2018-02-08T14:44:33-07:00
by ravengangrel
Thank you very much.
I have just downloaded and installed the latest, 7.0.7-22-x64-Q16-HDRI.
Changes in the delegates file:
<!-- delegate decode="dng:decode" stealth="True" command="dcraw.exe -6 -W -O "%u.ppm" "%i""/ -->
<delegate decode="dng:decode" command=""ufraw-batch.exe" --silent --wb=auto --create-id=also --out-type=png --out-depth=16 "--output=%u.png" "%i""/>
(The first line was commented, and the second one added, copied from an IM6 linux installation).
My commandline:
>magick mogrify -verbose -format jpg dng:IMG_0851.DNG
dng:IMG_0851.DNG=>IMG_0851.DNG DNG 5488x3664 5504x3664+2+0 16-bit sRGB 18.5213MiB 8.469u 0:02.626
dng:IMG_0851.DNG=>IMG_0851.jpg DNG 5488x3664 5504x3664+2+0 16-bit sRGB 7.30335MiB 0.828u 0:00.863
>ufraw-batch --wb=auto --out-type=png --out-depth=16 IMG_0851.dng
ufraw-batch: Loaded IMG_0851.dng
ufraw-batch: Saved G:\fotos\2017\2017-12-05 (prueba FN)\IMG_0851.png
>magick convert IMG_0851.png IMG_0851_from_ufraw.jpg
I hope these thumbnails will be enough to understand my problem. The IMG_0851.jpg image is too yellow.
Re: Latest IM ignores delegates?
Posted: 2018-02-08T17:13:55-07:00
by fmw42
Please post your DNG file as a separate file, so we can test it. You may want to zip it to prevent any changes.
I am still now sure I understand. Which delegate file (using dcraw or ufraw-batch) and IM version gave the wrong coloring and what was your command and IM version that gave the yellow output and what was the command and IM version that gave the better output. In which directory did you change the delegates.xml file? See
https://www.imagemagick.org/script/resources.php for the order in which folders are searched for the changed delegates.xml file.
I am getting confused about why you are comparing mogrify with convert. Is one or the other not working.
Re: Latest IM ignores delegates?
Posted: 2018-02-08T23:20:55-07:00
by ravengangrel
fmw42 wrote: ↑2018-02-08T17:13:55-07:00
I am getting confused about why you are comparing mogrify with convert. Is one or the other not working.
Sorry, I thought they were equivalent. Convert does a better job. I don't have time right now, but I'll get to it ASAP and I'll give more info.
Thank you very much!
Re: Latest IM ignores delegates?
Posted: 2018-02-08T23:31:37-07:00
by snibgo
See
http://www.imagemagick.org/discourse-se ... aw#p153488 , the announcement that recent releases of IM would use the libraw delegate library. I assume this means that raw files will be processed by
internal delegates, rather than
external delegates, via delegates.xml.
A colour cast suggests an incorrect white balance is being used.
Re: Latest IM ignores delegates?
Posted: 2018-02-08T23:47:34-07:00
by fmw42
It seems odd to me that mogrify would not give the same results as magick. But you are using "magick convert" which I think is then using IM 6 or at least is not exactly the same as just magick. You should use magick in place of convert, rather than magick convert. But for the other functions such as identify and mogrify and montage, you need to preface them with magick. But magick mogrify is still using the old IM 6 mogrify.
Perhaps mogrify is not accessing the same delegate as with convert. I really do not know the software that well. Snibgo is more an expert on that than I.
I would suggest you post your DNG file, so we can test with it.
Re: Latest IM ignores delegates?
Posted: 2018-02-09T13:13:06-07:00
by ravengangrel
Here is the zipped DNG:
https://wetransfer.com/downloads/2aa735 ... 435/68face
It will be available for a week I think.
Feel free to do with it whatever you want or need.
snibgo wrote: ↑2018-02-08T23:31:37-07:00A colour cast suggests an incorrect white balance is being used.
That was my first thought. Is it possible to adjust it via CLI for an internal delegate?
Is it not possible anymore to use external delegates for formats with internal support?
Re: Latest IM ignores delegates?
Posted: 2018-02-09T13:16:47-07:00
by ravengangrel
magick generates the same file -bit by bit- as magick convert, by the way. A really small file (3.57 kb), I think it's using the internal thumbnail.
Re: Latest IM ignores delegates?
Posted: 2018-02-09T13:27:49-07:00
by fmw42
If I convert the DNG to JPG and open both in Photoshop, they both look almost the same. The JPG is slightly darker, but not by much. There is no extra yellow cast to the JPG in comparing to the DNG. It might be simply a difference in brightness adjustment in the DNG when opened in PS from the DNG meta data. ImageMagick via ufraw delegate may not be handling that meta data exactly the same.
Re: Latest IM ignores delegates?
Posted: 2018-02-09T14:08:11-07:00
by snibgo
Sorry, with my pathetic internet connection I can't download your zipped dng.
ravengangrel wrote:Is it possible to adjust it via CLI for an internal delegate?
You can add an entry to delegates.xml with your own invented prefix, eg "mydng". Then use that prefix (with a colon) as input file to IM. The delegates.xml entry can call dcraw or ufraw-batch or whatever you want.
Re: Latest IM ignores delegates?
Posted: 2018-02-09T14:22:25-07:00
by fmw42
I am not as knowledgeable as snibgo about delegates, but can you not just modify the dng:decode entry to use whatever tool (dcraw, etc) and parameters to make it do what you want?
Code: Select all
<delegate decode="dng:decode" command=""ufraw-batch" --silent --create-id=also --out-type=png --out-depth=16 "--output=%u.png" "%i""/>
Re: Latest IM ignores delegates?
Posted: 2018-02-09T14:28:17-07:00
by snibgo
It seems that recent IM doesn't use delegates.xml for DNG files, so modifying the DNG entry will have no effect.
Re: Latest IM ignores delegates?
Posted: 2018-02-09T15:51:18-07:00
by fmw42
For my benefit, how do you know it does not use that delegate?