Image Magik is having a hard time with 14 Bits Per Sample

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
snibgo
Posts: 9720
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image Magik is having a hard time with 14 Bits Per Sample

Post by snibgo » 2018-01-12T00:30:32-07:00

Well, yes, "dcraw -e" extracts the JPEG from the NEF. This looks like the JPEG made by the camera, because it is the JPEG made by the camera.

Why did you add mode="encode" to the delegates.xml line?

I don't know how IM decides a NEF file should be treated as a DNG file. If you want to add your own entries to delegates.xml, I suggest you use a different decode name such as "mynef", then prefix your files with that name. For example, in delegates.xml:

Code: Select all

  <delegate decode="mynef" stealth="True" command="dcraw.exe -e -6 -W -w -O &quot;%o&quot; &quot;%i&quot;"/>
Then use:

Code: Select all

magick mynef:abc.nef out.tiff
snibgo's IM pages: im.snibgo.com

ksampan
Posts: 15
Joined: 2018-01-10T21:51:21-07:00
Authentication code: 1152

Re: Image Magik is having a hard time with 14 Bits Per Sample

Post by ksampan » 2018-01-12T01:25:01-07:00

Thanks for the reply. It is working

ksampan
Posts: 15
Joined: 2018-01-10T21:51:21-07:00
Authentication code: 1152

Re: Image Magik is having a hard time with 14 Bits Per Sample

Post by ksampan » 2018-02-08T08:15:26-07:00

Hi @snibgo,

magick mynef:abc.nef out.tiff

The thing you suggested out is working but in our application we are forming magick command using the extension of the file.
For suppose if it is abc.nef then the command would be "magick.exe nef:abc.nef out.tiff"
Can you suggest so that i can use something like

<delegate decode="nef" stealth="True" command="dcraw.exe -e -6 -W -w -O &quot;%o&quot; &quot;%i&quot;"/>

Thanks

ksampan
Posts: 15
Joined: 2018-01-10T21:51:21-07:00
Authentication code: 1152

Re: Image Magik is having a hard time with 14 Bits Per Sample

Post by ksampan » 2018-02-08T10:09:27-07:00

ksampan wrote:
2018-02-08T08:15:26-07:00
Hi @snibgo,

magick mynef:abc.nef out.tiff

The thing you suggested out is working but in our application we are forming magick command using the extension of the file.
For suppose if it is abc.nef then the command would be "magick.exe nef:abc.nef out.tiff"
Can you suggest so that i can use something like

<delegate decode="nef" stealth="True" command="dcraw.exe -e -6 -W -w -O &quot;%o&quot; &quot;%i&quot;"/>

Thanks

snibgo
Posts: 9720
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image Magik is having a hard time with 14 Bits Per Sample

Post by snibgo » 2018-02-08T18:23:22-07:00

Try it and see. Does it work? If it does, then that's fine.

If it doesn't work, it's because IM internally treats NEF as DNG, and finds the delegate for DNG. I think a command can override that only by using a prefix that is different to any standard prefix.
snibgo's IM pages: im.snibgo.com

ksampan
Posts: 15
Joined: 2018-01-10T21:51:21-07:00
Authentication code: 1152

Re: Image Magik is having a hard time with 14 Bits Per Sample

Post by ksampan » 2018-02-08T20:18:36-07:00

Hi thanks for the reply,

I haved tried with nef as delegate name, it is not working.
In the IM 6.0.3 i have changed the dng delegate is used as default delegate and i tried dng delegate command it is working where as in IM7.06 DNG delegate is not used by default i guess , because i have changed as previously i did for 6.0.3, it didnt work. Is the default delegate changed for 7.0.6 version ?

snibgo
Posts: 9720
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image Magik is having a hard time with 14 Bits Per Sample

Post by snibgo » 2018-02-08T21:02:42-07:00

See another thread from today: http://www.imagemagick.org/discourse-se ... =1&t=33491

It seems recent IM is using an internal delegate (libraw) for processing of DNG, NEF etc. So if you want an external delegate, you must either use a prefix, or rename your files with a different extension. In either case, you must use something distinctive, eg "mynef".
snibgo's IM pages: im.snibgo.com

ksampan
Posts: 15
Joined: 2018-01-10T21:51:21-07:00
Authentication code: 1152

Re: Image Magik is having a hard time with 14 Bits Per Sample

Post by ksampan » 2018-02-08T21:23:33-07:00

If we want to modify the dng delegate with some custom command where do we need to modify. As it doesnt pick from delegates.xml there is no point of changing there.

Thanks

snibgo
Posts: 9720
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image Magik is having a hard time with 14 Bits Per Sample

Post by snibgo » 2018-02-08T22:02:57-07:00

If you want your own processing, controlled at the command line, then use a prefix and an entry in delegates.xml.

Or if you are asking about modifying IM internals, then coder.c and coders\dng.c are the obvious places.
snibgo's IM pages: im.snibgo.com

ksampan
Posts: 15
Joined: 2018-01-10T21:51:21-07:00
Authentication code: 1152

Re: Image Magik is having a hard time with 14 Bits Per Sample

Post by ksampan » 2018-02-08T22:08:08-07:00

Hi @snibgo,

I couldn't find tcoder.c and coders\dng.c in my IM location.
BTW IM version : 7.0.6-5 Q16 x64

Thanks,

snibgo
Posts: 9720
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Image Magik is having a hard time with 14 Bits Per Sample

Post by snibgo » 2018-02-08T22:23:54-07:00

Have you downloaded the source code? If not, then that's why you don't have those files. They are available on github:

https://github.com/ImageMagick/ImageMag ... re/coder.c
https://github.com/ImageMagick/ImageMag ... ders/dng.c

It looks like you can control whether libraw is used by the compile-time switch MAGICKCORE_RAW_R_DELEGATE.
snibgo's IM pages: im.snibgo.com

ksampan
Posts: 15
Joined: 2018-01-10T21:51:21-07:00
Authentication code: 1152

Re: Image Magik is having a hard time with 14 Bits Per Sample

Post by ksampan » 2018-02-08T23:51:32-07:00

Hi snibgo,

My product install ImageMagick-7.0.6-5-Q16-x64-dll.exe this file and start using it.
In the installation location i couldnt find those specified files above.

Post Reply