Latest IM ignores delegates?

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?".
ravengangrel
Posts: 9
Joined: 2018-02-08T14:05:15-07:00
Authentication code: 1152

Latest IM ignores delegates?

Post 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.
ravengangrel
Posts: 9
Joined: 2018-02-08T14:05:15-07:00
Authentication code: 1152

Re: Latest IM ignores delegates?

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Latest IM ignores delegates?

Post 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
ravengangrel
Posts: 9
Joined: 2018-02-08T14:05:15-07:00
Authentication code: 1152

Re: Latest IM ignores delegates?

Post 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 &quot;%u.ppm&quot; &quot;%i&quot;"/ -->
<delegate decode="dng:decode" command="&quot;ufraw-batch.exe&quot; --silent --wb=auto --create-id=also --out-type=png --out-depth=16 &quot;--output=%u.png&quot; &quot;%i&quot;"/>

(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.
Image
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Latest IM ignores delegates?

Post 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.
ravengangrel
Posts: 9
Joined: 2018-02-08T14:05:15-07:00
Authentication code: 1152

Re: Latest IM ignores delegates?

Post 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!
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Latest IM ignores delegates?

Post 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.
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: Latest IM ignores delegates?

Post 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.
ravengangrel
Posts: 9
Joined: 2018-02-08T14:05:15-07:00
Authentication code: 1152

Re: Latest IM ignores delegates?

Post 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?
ravengangrel
Posts: 9
Joined: 2018-02-08T14:05:15-07:00
Authentication code: 1152

Re: Latest IM ignores delegates?

Post 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.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Latest IM ignores delegates?

Post 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.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Latest IM ignores delegates?

Post 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.

Code: Select all

magick mydng:abc.dng out.tiff
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: Latest IM ignores delegates?

Post 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="&quot;ufraw-batch&quot; --silent --create-id=also --out-type=png --out-depth=16 &quot;--output=%u.png&quot; &quot;%i&quot;"/>
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Latest IM ignores delegates?

Post by snibgo »

It seems that recent IM doesn't use delegates.xml for DNG files, so modifying the DNG entry will have no effect.
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: Latest IM ignores delegates?

Post by fmw42 »

For my benefit, how do you know it does not use that delegate?
Post Reply