IM 6.7.4.7 Q16 Mac OSX Snow Leopard
In reference to: viewtopic.php?f=1&t=20193&p=80040#p80026
I am no expert on PTIF, but it looks to me like the -define for the tile size is not working. I would expect the last level to be the tile size. Correct me if I am wrong.
convert -size 1024x1024 gradient: grad1024.png
convert grad1024.png -define tiff:tile-geometry=128x128 ptif:grad1024.tif
identify grad1024.tif
grad1024.tif[0] TIFF 1024x1024 1024x1024+0+0 16-bit Grayscale DirectClass 42.7KB 0.000u 0:00.000
grad1024.tif[1] TIFF 512x512 512x512+0+0 16-bit Grayscale DirectClass 42.7KB 0.000u 0:00.000
grad1024.tif[2] TIFF 256x256 256x256+0+0 16-bit Grayscale DirectClass 42.7KB 0.000u 0:00.000
grad1024.tif[3] TIFF 128x128 128x128+0+0 16-bit Grayscale DirectClass 42.7KB 0.000u 0:00.000
grad1024.tif[4] TIFF 64x64 64x64+0+0 16-bit Grayscale DirectClass 42.7KB 0.000u 0:00.000
I also get the same results from using -define tiff:tile-geometry=256x256
So it looks to me like it is creating tiles of 64x64, which may be the default and thus the -define is not working or not documented correctly.
possible bug ptif tile -define IM 6.7.4.7 Q16
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
possible bug ptif tile -define IM 6.7.4.7 Q16
Last edited by fmw42 on 2013-08-01T17:04:59-07:00, edited 2 times in total.
Re: possible but ptif tile -define IM 6.7.4.7 Q16
The tile-geometry define refers to how pixels are stored inside any TIFF image. For example:
- convert logo: -define tiff:tile-geometry=128x128 logo.tif
-> tiffinfo logo.tif
TIFF Directory at offset 0x7404 (29700)
Image Width: 640 Image Length: 480
Tile Width: 128 Tile Length: 128
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible but ptif tile -define IM 6.7.4.7 Q16
So then for tile sizes larger than 64x64, any levels below the tile size will be padded to the tile size specified, such as in this case, the last level will be 128x128, but only have image data for 64x64 and padded out to 128x128?The pyramid-encoded TIFF image halfs the image size until it is less that 64x64. Currently you cannot define this value.
Re: possible but ptif tile -define IM 6.7.4.7 Q16
Storage is handled by the TIFF library, not ImageMagick. Specifically we simply take the value from the define and set the TIFFTAG_TILEWIDTH and TIFFTAG_TILELENGTH fields. For exactly how storage is handled when a tile geometry is specified refer to the libtiff documentation or the TIFF format specification.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible but ptif tile -define IM 6.7.4.7 Q16
thanks for the information and the reference to tiffinfo as I could not find any of that data listed in the IM verbose info:
someday it would be nice if the IM verbose info could identify the tiff as ptif format and the tile size info.
do you know of any (Mac or Unix) tools that will view PTIFs? Even Photoshop does not seem to be able to handle it, though I am no expert on its use.
someday it would be nice if the IM verbose info could identify the tiff as ptif format and the tile size info.
do you know of any (Mac or Unix) tools that will view PTIFs? Even Photoshop does not seem to be able to handle it, though I am no expert on its use.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: possible but ptif tile -define IM 6.7.4.7 Q16
Turns out that GIMP will display PTIFs (all levels or select a level) as images or layers, BUT only if the image is depth 8. In IM, display will only show the first level (largest) but also only if -depth 8
So use:
convert -size 1024x1024 gradient: grad1024.png
convert grad1024.png -define tiff:tile-geometry=128x128 -depth 8 ptif:grad1024.tif
So use:
convert -size 1024x1024 gradient: grad1024.png
convert grad1024.png -define tiff:tile-geometry=128x128 -depth 8 ptif:grad1024.tif
Re: possible but ptif tile -define IM 6.7.4.7 Q16
We can reproduce the problem you reported. We'll get a patch into the next point release of ImageMagick. Thanks.