[R] reading tiff files
Prof Brian Ripley
ripley at stats.ox.ac.uk
Tue Nov 20 18:09:12 CET 2001
On Tue, 20 Nov 2001, Laurent Gautier wrote:
> I have not expertise in the tiff format, but browsing the documentation
> for the libtiff C library I thought something suitable for some cases
> could be done (see the quote below).
`some cases', yes. libtiff is widely used in those conversion tools.
Just be careful not to claim all tiff files. In particular some include
patent-encumbered compression and are probably incompatible with GPL-ed
> If anybody reports having experienced problems with that..... it's a
> different story....
We've met quite a lot of tiff files that libtiff does not handle. Our
scanner software generates them unless forced to turn all compression off.
Others came from some digital cameras.
BTW, one problem with libtiff is that some Unix-alike OSes include
modified versions, which makes linking against it tricky.
> TIFFRGBAImage Support
> libtiff provides a high-level interface for reading image data from a
> TIFF file. This interface handles the details of data organization and
> format for a wide variety of TIFF files; at least the large majority of
> those files that one
> would normally encounter. Image data is, by default, returned as ABGR
> pixels packed into 32-bit words (8 bits per sample). Rectangular rasters
> can be read or data can be intercepted at an intermediate level and
> into memory in a format more suitable to the application. The library
> handles all the details of the format of data stored on disk and, in
> most cases, if any colorspace conversions are required: bilevel to RGB,
> greyscale to
> RGB, CMYK to RGB, YCbCr to RGB, 16-bit samples to 8-bit samples,
> associated/unassociated alpha, etc.
> Prof Brian Ripley wrote:
> > On Tue, 20 Nov 2001, Laurent Gautier wrote:
> > > Dear all,
> > >
> > >
> > > Following the answers to my previous post, it seems that the way is to
> > > convert first the picture before being abble to read it using the
> > > pixmap package.
> > >
> > > Would it make sense to have a function in pixmap to directly read tiff
> > > file ?
> > >
> > > I was thinking of making a function for that would do the job, and would
> > > be ready to make the extra step to have something eventually usefull for
> > > others (and why not included in the pixmap package).
> > >
> > > suggestions ?
> > Unfortunately, I believe tiff is not well-defined as it is an extensible
> > format with a very large number of possibilities. I think this is best
> > left to an external tool, none of which are (AFAIK) comprehensive.
> > AFAIR, pdftex took out tiff support after a while for exactly this reason.
> > --
> > Brian D. Ripley, ripley at stats.ox.ac.uk
> > Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
> > University of Oxford, Tel: +44 1865 272861 (self)
> > 1 South Parks Road, +44 1865 272860 (secr)
> > Oxford OX1 3TG, UK Fax: +44 1865 272595
> > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
> > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
> > Send "info", "help", or "[un]subscribe"
> > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
> > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
> Laurent Gautier CBS, Building 208, DTU
> PhD. Student D-2800 Lyngby,Denmark
> tel: +45 45 25 24 85 http://www.cbs.dtu.dk/laurent
Brian D. Ripley, ripley at stats.ox.ac.uk
Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/
University of Oxford, Tel: +44 1865 272861 (self)
1 South Parks Road, +44 1865 272860 (secr)
Oxford OX1 3TG, UK Fax: +44 1865 272595
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
More information about the R-help