ImageMagick questions

Jhausler

Established
Local time
1:52 PM
Joined
Oct 5, 2013
Messages
141
Any ImageMagick users out there?

I recently started "scanning" negatives with an M9 and wanted an easy way to invert the files before importing into LR.

I know I can just invert the Tone Curve, but then everything is backwards and my brain can't handle that :)

I wrote up a super simple script to run on a folder full of DNGs:
for i in *.DNG; do convert -negate ${i%.*}.DNG ${i%.*}.tif; done

I did this because apparently while IM can read DNG files, it cannot write them.

It seems to work well. I intend to dump the DNGs and just keep the TIFs. I have the negatives, so it's not as if i'm deleting the "originals".

Here come the questions...

1) Am I losing any data through this conversion?

2) The DNG files start at around 36.4mb but the TIF files are all close to 90mb. Is there any way to trim these without losing any data?​

I'll probably come up with more, but this is a good start to see if there are any IM users out there.

Thanks,
Jesse
 
Try adding a -compress option, such as lzw or zip. You may need to experiment a bit to find something that is both small and compatible with your software (I use zip with CaptureOne, but most things work with Adobe).

The TIFFs should be lossless, but the Bayer demosaicing algorithm will have been baked-in during conversion (probably the Apple RAW conversion) which may mean that you get a different result from using the dng directly. Exactly what depends on the software that you use, but it can affect things like lens distortion and chromatic abberation corrections - although for macro/copy work I doubt that you would see any real difference.

It is a shame that there is not a standardised lossless compression scheme that works efficiently with photographs.
 
hmm.. i couldn't get lightroom to import a .zip.

Do i still save it as a .tif as in..

convert -compress zip L1234.tif L1234.tif?

I did
convert -compress zip L1234.tif L1234.zip
 
In case you haven't figured it out yet... yes, you still save it as a TIF, not as a ZIP file. the -compress zip option tells ImageMagick to convert the TIF image to a TIF, with "internal" zip compression (for lack of a better word). But it should still have the same extension.

So to sum it up, this is correct:
convert -compress zip L1234.tif L1234.tif
 
I haven't used IM for years, but I use FIJI (ImageJ) a lot at work. If I remember correctly, you can save the image as a RAW file in IM just like FIJI, which you essentially choose the way the file is written and the format (we use it to write phase and aptitude complex images). It might be a little f*ing around, but once it's scripted ...
 
Back
Top Bottom