Friday 29 December 2017

bit depth - Lossy archival compression for 16-bit TIF images


I sometimes use the Nik collection to process my photos, and because this runs on TIFF images, I end up with demosaiced files eating up more disk space than they're worth.


I want to batch convert these files for archival. JPEG2000 sounds good on paper, but I think the basic imagemagick invocation isn't good.



Source file: https://drive.google.com/file/d/1KqYEQealzgptpt8DjJp30yy-QNP-D2Dq/view?usp=sharing (178MB)


16-bit TIF source


Crop of shadows boosted from TIF file:


TIF image crop


8-bit JPG


Crop of shadows boosted from a JPEG conversion shows good detail but color blocking (magick convert DSC02449-Pano-Edit-2.tif -quality 97 DSC02449-Pano-Edit-2.jpg, output 8.2M):



JPG converted image crop


16-bit JPEG-2000 (imagemagick encoder)


The JP2 image has horrible loss of detail (magick convert DSC02449-Pano-Edit-2.tif -define jp2:quality=50 DSC02449-Pano-Edit-2.jp2, output 8.0M).


JP2 converted image crop


16-bit JPEG-2000 (Photoshop encoder)


The Photoshop JPEG 2000 encoder looks good. There is some loss of detail in the streams of water, but this seems more than acceptable at the compression ratio, and there are no obvious artifacts (blocking, color errors, severe loss of detail). I had it match the output size of the JPG (8.3M).


JPF photoshop encoder converted image crop


8-bit HEIC


I don't know how to adjust the quality settings of the HEIC encoder, it just seemed to have one preset. It seems to be off in color but has decent detail and no blocking (magick convert DSC02449-Pano-Edit-2.tif DSC02449-Pano-Edit-2.heic, 12.1M). Loading the image in Photoshop, or converting back to TIF suggests it only has 8-bit depth.


HEIC converted image crop




While JPG looks like a decent option here, I think there's a risk that if I'm running it in batch on a bunch of images I don't look at, it could lose a lot of information if there's a dark image where I haven't adjusted the shadows properly or something.



  • Is there a better invocation of the ImageMagic JPEG2000 encoder? (Or a way to invoke the Photoshop encoder in batch?)

  • Can I archive these images as single-frame x265 movies? I've heard that encoder is very efficient and supports high bit depths. This is an inconvenient format, but I am mostly archiving these images and unlikely to interact with them much.


(I'm using ImageMagick 7.0.9-10 Q16 x86_64 2019-12-23 installed via HomeBrew for OS X 10.15 "Catalina". Related question for different goal and without comparison images: Is there a lossy compressed file format for 16-bit dynamic range images?)




No comments:

Post a Comment

Why is the front element of a telephoto lens larger than a wide angle lens?

A wide angle lens has a wide angle of view, therefore it would make sense that the front of the lens would also be wide. A telephoto lens ha...