Page 1 of 1

Mogrify -negate a DNG file.

Posted: 2016-05-26T15:05:04-07:00
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

Re: Mogrify -negate a DNG file.

Posted: 2016-05-26T15:15:25-07:00
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.

Re: Mogrify -negate a DNG file.

Posted: 2016-05-26T16:42:42-07:00
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.

Re: Mogrify -negate a DNG file.

Posted: 2016-05-26T17:11:44-07:00
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.

Re: Mogrify -negate a DNG file.

Posted: 2016-05-26T17:33:49-07:00
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).

Re: Mogrify -negate a DNG file.

Posted: 2016-05-26T20:19:53-07:00
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.

Re: Mogrify -negate a DNG file.

Posted: 2016-05-26T20:35:50-07:00
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.

Re: Mogrify -negate a DNG file.

Posted: 2016-05-26T20:45:10-07:00
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?

Re: Mogrify -negate a DNG file.

Posted: 2016-05-26T23:16:06-07:00
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.