Page offsets are lost when saving TIFF
Posted: 2013-07-24T02:48:02-07:00
When saving a TIFF both horizontal and vertical page offsets are lost when any of them (horizontal or vertical) <= 0:
The same saving PNG works properly:
Re-paging.
Using TIFF:
Using PNG:
Software versions:
Code: Select all
$ sf=tif; sz=16x16; for x in -16 +0 +16; do for y in -16 +0 +16; do convert -size $sz -page $sz$x$y -depth 8 -units PixelsPerInch -density 300 xc:gray50 $sz$x$y.$sf; identify -format '%f (%m) %g\n' $sz$x$y.$sf; done; done
16x16-16-16.tif (TIFF) 16x16+0+0
16x16-16+0.tif (TIFF) 16x16+0+0
16x16-16+16.tif (TIFF) 16x16+0+0
16x16+0-16.tif (TIFF) 16x16+0+0
16x16+0+0.tif (TIFF) 16x16+0+0
16x16+0+16.tif (TIFF) 16x16+0+0
16x16+16-16.tif (TIFF) 16x16+0+0
16x16+16+0.tif (TIFF) 16x16+0+0
16x16+16+16.tif (TIFF) 16x16+16+16
Code: Select all
$ sf=png; sz=16x16; for x in -16 +0 +16; do for y in -16 +0 +16; do convert -size $sz -page $sz$x$y -depth 8 -units PixelsPerInch -density 300 xc:gray50 $sz$x$y.$sf; identify -format '%f (%m) %g\n' $sz$x$y.$sf; done; done
16x16-16-16.png (PNG) 16x16-16-16
16x16-16+0.png (PNG) 16x16-16+0
16x16-16+16.png (PNG) 16x16-16+16
16x16+0-16.png (PNG) 16x16+0-16
16x16+0+0.png (PNG) 16x16+0+0
16x16+0+16.png (PNG) 16x16+0+16
16x16+16-16.png (PNG) 16x16+16-16
16x16+16+0.png (PNG) 16x16+16+0
16x16+16+16.png (PNG) 16x16+16+16
Using TIFF:
Code: Select all
$ sf=tif; sz=16x16; for x in -16 +0 +16; do for y in -16 +0 +16; do convert -size $sz -page $sz+1+1 -depth 8 -units PixelsPerInch -density 300 xc:gray50 $sz$x$y.$sf; identify -format '%f (%m) %g\n' $sz$x$y.$sf; convert $sz$x$y.$sf -repage $sz$x$y $sz$x$y.$sf; identify -format '%f (%m) %g\n' $sz$x$y.$sf; done; done
16x16-16-16.tif (TIFF) 16x16+1+1
16x16-16-16.tif (TIFF) 16x16+0+0
16x16-16+0.tif (TIFF) 16x16+1+1
16x16-16+0.tif (TIFF) 16x16+0+0
16x16-16+16.tif (TIFF) 16x16+1+1
16x16-16+16.tif (TIFF) 16x16+0+0
16x16+0-16.tif (TIFF) 16x16+1+1
16x16+0-16.tif (TIFF) 16x16+0+0
16x16+0+0.tif (TIFF) 16x16+1+1
16x16+0+0.tif (TIFF) 16x16+0+0
16x16+0+16.tif (TIFF) 16x16+1+1
16x16+0+16.tif (TIFF) 16x16+0+0
16x16+16-16.tif (TIFF) 16x16+1+1
16x16+16-16.tif (TIFF) 16x16+0+0
16x16+16+0.tif (TIFF) 16x16+1+1
16x16+16+0.tif (TIFF) 16x16+0+0
16x16+16+16.tif (TIFF) 16x16+1+1
16x16+16+16.tif (TIFF) 16x16+16+16
Code: Select all
$ sf=png; sz=16x16; for x in -16 +0 +16; do for y in -16 +0 +16; do convert -size $sz -page $sz+1+1 -depth 8 -units PixelsPerInch -density 300 xc:gray50 $sz$x$y.$sf; identify -format '%f (%m) %g\n' $sz$x$y.$sf; convert $sz$x$y.$sf -repage $sz$x$y $sz$x$y.$sf; identify -format '%f (%m) %g\n' $sz$x$y.$sf; done; done
16x16-16-16.png (PNG) 16x16+1+1
16x16-16-16.png (PNG) 16x16-16-16
16x16-16+0.png (PNG) 16x16+1+1
16x16-16+0.png (PNG) 16x16-16+0
16x16-16+16.png (PNG) 16x16+1+1
16x16-16+16.png (PNG) 16x16-16+16
16x16+0-16.png (PNG) 16x16+1+1
16x16+0-16.png (PNG) 16x16+0-16
16x16+0+0.png (PNG) 16x16+1+1
16x16+0+0.png (PNG) 16x16+0+0
16x16+0+16.png (PNG) 16x16+1+1
16x16+0+16.png (PNG) 16x16+0+16
16x16+16-16.png (PNG) 16x16+1+1
16x16+16-16.png (PNG) 16x16+16-16
16x16+16+0.png (PNG) 16x16+1+1
16x16+16+0.png (PNG) 16x16+16+0
16x16+16+16.png (PNG) 16x16+1+1
16x16+16+16.png (PNG) 16x16+16+16
Code: Select all
$ uname -srm
FreeBSD 8.4-STABLE amd64
$ gcc -v
Using built-in specs.
Target: amd64-undermydesk-freebsd
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]
$ identify -version
Version: ImageMagick 6.8.6-6 2013-07-23 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC HDRI OpenMP
Delegates: bzlib fftw fpx fontconfig freetype jbig jng jp2 jpeg lcms lqr openexr png ps rsvg tiff wmf x xml zlib
$ pkg_info -E -x ^tiff -x ^png
png-1.5.16
tiff-4.0.3