[R] readTiff - Sorry can't handle images with 32-bit samples

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Jul 27 08:12:23 CEST 2013


It is a little more complex than that.

readTiff is not part of R.  It is in an unstated package, and there are 
instances in packages biOps and rtiff.

There are also readTIFF in packages tiff and beadArray.  It is 
tiff::readTIFF that I would recommend.  Its help says it can read 32-bit 
tiffs.

rtiff::readTiff is old, limited and orphaned.

Secondly, all of these are interfaces to libtiff, and that is an OS 
library.  So what images they can read mainly depends on what version of 
libtiff and what capabilities it was configured to provide.  Athough we 
were not told (see the posting guide) it looks like the OP was using 
Windows.  There I compiled libtiff from source and it is a fairly 
minimal build (not least as most people with complex image requirements 
do not use Windows).

There are other ways to read TIFF files, e.g. rgdal and EBImage.  See 
the R manuals, specifically 
http://cran.r-project.org/doc/manuals/r-release/R-data.html#Image-files 
.  E.g. some versions of rgdal have support for 12-bit TIFFs that 
libtiff cannot handle.

In short: use a better tool.


On 26/07/2013 23:08, Peter Langfelder wrote:
> Disclaimer: I haven't seen your tif file and I know nothing about
> readTiff... but here go some general comments.
>
> TIF files can use different bit depths (number of bits to store each
> pixel (or each color for each pixel). Most common software outputs 8-
> or 16-bits, but your file probably has a higher bit depth of 32 bits
> per sample. Apparently readTiff cannot handle such bit depth.
>
> You may need to convert the 32-bit delth file(s) into 16-bit depth (or
> whatever readTiff can handle). My suggestion would be to look at
> ImageMagick, but you may also be able to use some image editing
> applications to do that,
>
> Peter
>
> On Fri, Jul 26, 2013 at 1:51 PM, wwreith <reith_william at bah.com> wrote:
>> I tried using readTiff() and got the error message "Sorry can't handle images
>> with 32-bit samples"
>>
>> line of code
>>
>> x <- readTiff("C:/Users/550062/Desktop/Data/example1.tif")
>>
>> So far I have not had any luck finding this error message on google. Any
>> guess at what it means and how to get the code to work?
>>
>> Thanks!


-- 
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 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595



More information about the R-help mailing list