(none) imager-devel
/ help / lists / applications / search /

Re: tiff with 32 bit signed integers

From: Bruce Ravel (
Date: Tue 31 Jan 2012 - 16:02:37 GMT

On Monday, January 30, 2012, 06:22:57 pm, Tony Cook wrote:

> The convenience handler that allows you to supply a non-color object
> as a color always works with 8-bit color, which is then translated to
> the depth of the image you're working with.
> To set the value using a double-per-sample color you need to create an
> Imager::Color::Float object:
> my $c = Imager::Color::Float->new(1, 0, 0);
> $imager->setpixel(x => 86, y => 150, color => $c);
> or the "handy" shortcut:
> use Imager ':handy';
> $imager->setpixel(x => 86, y => 150, color => NCF(1, 0, 0));

Hi Tony,

Thank you for explaining that. That does exactly what I was hoping for.

> I would have suggested using PDL for this type of work, but it seems
> to have limited TIFF support.

Oh, PDL was my first thought as well. It's tiff handling is entirely
dependent upon netpbm and how that is compiled. While it would almost
certainly make my program faster to compile up netpbm appropriately and to do
all the matrix math with PDL, Imager has the great virtue of managing my funny
tiff files out of the box even on Windows. That makes it much easier to
support distant collaborators.

Thanks for everything,

 Bruce Ravel  ------------------------------------ 19801@xyz.molar.is

National Institute of Standards and Technology Synchrotron Methods Group at NSLS --- Beamlines U7A, X24A, X23A2 Building 535A Upton NY, 11973

My homepage: http://xafs.org/BruceRavel EXAFS software: http://cars9.uchicago.edu/~ravel/software/exafs/