Re: [R] Making TIFF images with rtiff

From: Prof Brian Ripley <>
Date: Fri 12 Jan 2007 - 08:07:39 GMT

Let us be clear that TIFF is not a format, it is a collection of formats and for example my camera's RAW images are TIFFs, as are Adobe's DNG files. (See e.g. So the journals concerned are misusing the term. It is very easy to convert either JPEGs or PNGs to a TIFF subformat with ImageMagick, PhotoShop or other tools, and the bitmap() driver can write several versions of TIFF by converting from postscript (transparently to the user).

I think the complaints in this thread are a bit rich given how much R aleady provides. We thought about adding a few TIFF formats to PNG, JPEG and BMP but agreed it was not worth effort (especially given the vagueness with which 'TIFF' is used and stories about journals rejecting perfectly valid TIFF files). [I don't recall anyone ever writing to thank us for the PNG or JPEG or bitmap drivers, and lack of appreciation does play a part.]

An 8-bit TIFF device is not going to produce better images than the PNG one, just larger files. (It could if you rendered HDR TIFF images, but the journal will not be able to cope with those.)

On Thu, 11 Jan 2007, Inman, Brant A. M.D. wrote:

> Many medical journals and publishers require that images, whether
> photographs or line art, be submitted as high resolution .TIFF images.
> One option for R users is to produce an image in one format and to
> convert it to a .TIFF file using a second software program. My
> experience has been that this option often results in images of poorer
> quality, often with blurry contours, and a loss of resolution. A second
> and better option would be to make .TIFF files directly from the graphic
> output of R.

As TIFF is collection of bitmap formats, the blurriness is intrinisic to the format. You are not telling us what you converted *from* (nor what sort of images these are nor what convertor you used): for most R applications PNG is the right image format to convert from and conversion from PNG to TIFF will be lossless. (PS/PDF are not image formats, but also good starting points for conversion.)

> I recently noticed that there is a library called "rtiff" that may be
> able to do this. However, I have not been able to get it to work,
> principally because I do not know how to install the required supporting
> software, libtiff and tiffio.h, correctly on my computer. I am running R
> 2.4.0 on a Windows XP machine. So far I have done the following:
> 1) Loaded the rtiff library

Do you mean 'package'? There is a precompiled Windows build: did you use that? What it needs is libtiff3.dll, which is in the software you downloaded: put it in R_HOME/rtiff/libs or somewhere on your PATH. (Sadly, the package is lacking adequate instructions.)

> 2) Downloaded and installed the TIFF library 3.8.2 (complete package and
> sources) from the following website:
> I would like to ask the R experts for help with the following things:
> 1) Where do I get the tiffio.h file?

It is part of the libtiff software you downloaded, but it says it is only needed to install from the sources.

> 2) Where do I install or relocate the tiffio.h and TIFF library to so
> that rtiff will work?
> Thanks for your help.
> Brant Inman
> Mayo Clinic
> ______________________________________________
> mailing list
> PLEASE do read the posting guide
> and provide commented, minimal, self-contained, reproducible code.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Fri Jan 12 19:15:11 2007

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 12 Jan 2007 - 19:31:32 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.