[R-SIG-Mac] tiff does not seem to respect resolution & compression

Andrew Steen andrew.decker.steen at gmail.com
Mon May 27 04:46:03 CEST 2013

Running R 3.0.0 on Mac OSX 10.7.5, tiff() does not seem to respect the
res and compression arguments. For example,

x <- rnorm(1000)
tiff("nocompress.tif", height=6, width=6, res=200, units="in")

yields a file of 5.8 MB.

tiff("compress.tif", height=6, width=6, res=200, units="in", compression="lzw")

also yields a file of 5.8 MB (which seems very large for a 6in x 6in,
black-and-white lzw compressed image!) Furthermore, Photoshop seems to
think that it is a 16.67 x 16.67 inch image at 72 ppi, as if tiff is
calculating the number of pixels correctly but not setting some kind
of image attribute for size.

A Stack Overflow user describes a similar problem at
That thread shows that the issue crops up on several R releases and
versions of OSX, but I can't find anyone who has diagnosed the problem
or identified a solution.


More information about the R-SIG-Mac mailing list