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: 12159
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 »

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: 16
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 »

Thanks for the reply. It is working
ksampan
Posts: 16
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 »

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: 16
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 »

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: 12159
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 »

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: 16
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 »

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: 12159
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 »

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: 16
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 »

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: 12159
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 »

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: 16
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 »

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: 12159
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 »

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: 16
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 »

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