Mogrify -negate a DNG file.

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?".
Post Reply
jhausler
Posts: 4
Joined: 2016-05-26T14:59:43-07:00
Authentication code: 1151

Mogrify -negate a DNG file.

Post by jhausler »

I've been taking photos of my film negatives using a digital camera. I want to use IM to invert the images to make it easier to process in Lightroom and i've tried a few things.

mogrify -negate L123.DNG


This appears to do something.. but it doesn't invert the negative image. Can one mogrify a DNG?

Earlier I used convert to create an inverted tif file:
convert -negate L123.DNG L123.tif

This worked ok, but the file size was 3x larger, which isn't ideal. I also tried the following, but it didn't make a difference
convert -negate -compress zip L123.DNG L123.tif

Thanks for your help,
Jesse


For reference:
$ convert -version
Version: ImageMagick 6.9.2-4 Q16 x86_64 2015-12-26 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC Modules
Delegates (built-in): bzlib djvu fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp x xml zlib
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mogrify -negate a DNG file.

Post by fmw42 »

convert -negate -compress zip L123.DNG L123.tif
Proper IM 6 and most importantly for IM 7 is to read the input image first.

Code: Select all

convert L123.DNG -negate -compress zip L123.tif
but this will not likely matter, except possibly for IM 7.

However, I suggest that DNG may be better compressed than tiff with zip compression.

mogrify should work also, but it is generally better to use the more current and flexible convert when dealing with only one image.

You cannot use mogrify with DNG back to DNG because IM only reads DNG. So you need to specify -format XX for the output in mogrify.

You might get better compression of the TIFF with JPG compression, but it is lossy. Or write to JP2 format for output.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mogrify -negate a DNG file.

Post by fmw42 »

I am not a DNG expert nor an expert in DCRAW, but you may be able to read and write and negate your image directly in DCRAW. One of the DCRAW experts would need to confirm.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Mogrify -negate a DNG file.

Post by snibgo »

Dcraw doesn't have an option to directly negate an image. Option "+M" will "use an embedded color matrix", so if the image contained a suitable matrix, this would negate it.

If these are colour negatives, you would need to remove the orange mask that colour films had.
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: Mogrify -negate a DNG file.

Post by fmw42 »

I have a script, negative2positive, that might help to do the proper negate, if using Unix system (Linux, Mac OSX, Windows with Cygwin).
jhausler
Posts: 4
Joined: 2016-05-26T14:59:43-07:00
Authentication code: 1151

Re: Mogrify -negate a DNG file.

Post by jhausler »

Thanks all for the input.

fmw42. I'll check out negative2positive. Will it keep my DNGs in DNG format? I mainly hope to flip the image and then do everythign else in Lighroom, including whitebalancing the orange mask out... unless someone has a script or trigger that will do that as well. I'm new to IM and it's pretty cool what you all can do with this tool.
jhausler
Posts: 4
Joined: 2016-05-26T14:59:43-07:00
Authentication code: 1151

Re: Mogrify -negate a DNG file.

Post by jhausler »

n2p is a pretty cool script. the auto whitebalance works quite well from what I can see.
I still have to go to TIFF, but i think it will give me more latitude with the WB sliders in Lightroom once i'm in there.

thanks for the tips.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Mogrify -negate a DNG file.

Post by fmw42 »

Will it keep my DNGs in DNG format?
No, because the limitation is that IM will not write to DNG, so my script will not either.

Why do you need to go to TIFF? Will some other format suffice, such as JP2 or PNG?
jhausler
Posts: 4
Joined: 2016-05-26T14:59:43-07:00
Authentication code: 1151

Re: Mogrify -negate a DNG file.

Post by jhausler »

I honestly don't know that i *have* to go to TIFF. I just want to make sure that I can' manipulate the file all I want in LR without concern for file degradation. I know I'll get that from DNG and I believe I get that with TIFF. I'm not familiar with how malleable those other formats are.
Post Reply