I am using the following loop convert about 250 .tif files to tiled pyramid .tif file, each file is about 15 to 35 mb:
for i in *.tif; do convert $i -define tiff:tile-geometry=256x256 -compress jpeg 'ptif:tiled-'$i; done
This is working for probably a little over half of the images: I get a compressed, tiled .tif file at about 1/4 the size of the original. For the ones that aren't working, I am getting an image file outputted that's probably about 4,000 bytes large and the one error that seems to pop with -debug all
is Bogus input colorspace. "JPEGLib"
. These images do not appear if piped through IIP Image Server and won't open in an image viewer.
I have localized it to perhaps the -compress jpeg
argument. If I run without compression, or a lossless compression like -compress LossLess JPEG
, it appears to work, but the tiled images are (obviously) larger than the original, which is what I am trying to avoid.
running tiffinfo
against an image that doesn't convert against an image that does I get:
Broken
$ tiffinfo WH-001.tif
TIFF Directory at offset 0x106842c (17204268)
Image Width: 1735 Image Length: 2479
Resolution: 72, 72 pixels/inch
Bits/Sample: 8
Compression Scheme: None
Photometric Interpretation: RGB color
Extra Samples: 1<unassoc-alpha>
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 4
Rows/Strip: 1
Planar Configuration: single image plane
Page Number: 0-1
DocumentName: WH-001.tif
Working
$ tiffinfo WH-090.tif
TIFFReadDirectory: Warning, Unknown field with tag 32934 (0x80a6) encountered.
TIFF Directory at offset 0xd4 (212)
Subfile Type: (0 = 0x0)
Image Width: 2800 Image Length: 4160
Resolution: 600, 600 pixels/inch
Bits/Sample: 8
Compression Scheme: None
Photometric Interpretation: RGB color
FillOrder: msb-to-lsb
Orientation: row 0 top, col 0 lhs
Samples/Pixel: 3
Rows/Strip: 3
Planar Configuration: single image plane
Software: Oi/GFS, writer v00.06.02
Tag 32934: 0
ICC Profile: <present>, 3144 bytes
Though I am not sure how to tell why the one is broken and why the other one works.