[IPOL discuss] IEEE floating point images

Nicolas Limare nicolas.limare at cmla.ens-cachan.fr
Fri Jun 3 04:21:57 CEST 2011


Hi,

> My understanding is that the IPOL io_tiff library is currently limited
> internally to reading and writing with 8-bit data.

If your are talking about the io_tiff code available on
http://www.ipol.im/meta/dev/, this code, contributed by Pascal
Monasse, reads and writes IEEE single-precision data.

> For reading, it uses libtiff's simple TIFFReadRGBAImage function to
> read the data.  This function reads and converts all data formats to
> red-green-blue-alpha using 8 bits per component.  The read_tiff_f32
> function then converts the 8-bit data to 32-bit floating point.

No, it reads with TIFFReadScanline() and writes with TIFFWriteScanline()
-> http://dev.ipol.im/git/?p=nil/io_tiff.git;a=blob;f=io_tiff.c

I think you are talking about an older io_tiff code, which was used
for integer images, but is not distributed on IPOL (PNG is the way to
go with integer images).

> > I am using the reading and writing functions ("write_tiff_f32()")
> > provided by IPOL. Does anyone if it is fine ?

Pascal wrote it, so he can probably answer your question. Be sure to
use the real float code from http://www.ipol.im/meta/dev/, not the
bad 'integer-values-as-float' one.

>> Also, I understand that using "1x8i" or "3x8i" for "input_dtype" in app.py
>> corresponds to using 8-bit gray-scale or 3x8-bit color images. Does that
>> mean that all images are converted to 8-bit-kind images?

Yes. All input images received by the ipol demos are converted to
8bit, because:
* 99.99% of the images people have on their computers are integer
  images (actually, the number is probably 99.999999...);
* there is no reliable support in the conversion code (either using
  Python Imaging Library or imagemagick tools) to read or write float TIFF.

>> Does anyone have a simple solution?

* read integer images, because that's what IPOL demos can handle
  and that's what people will submit
* convert to float and process float data
* write float images (TIFF float, Pascal's io_tiff should be OK) *and*
  approached integer images for www visualization (I think PNG is
  better, use io_png)

This is a short-term mixed strategy.

If you really need to read float data from the IPOL demos, this is
impossible until we have reliable TIFF float support in external
tools. We would need a way to convert any uploaded image (including
integer jpeg and png) to a TIFF float. Anyone volunteers to contribute
to PIL and imagemagick?

-- 
Nicolas LIMARE - CMLA - ENS Cachan    http://www.cmla.ens-cachan.fr/~limare/
IPOL - image processing on line                          http://www.ipol.im/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://tools.ipol.im/mailman/archive/discuss/attachments/20110603/2b15d744/attachment.pgp>


More information about the discuss mailing list