help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: pngread does not read 12bit gray images


From: de Almeida, Valmor F.
Subject: RE: pngread does not read 12bit gray images
Date: Wed, 16 Jul 2008 18:49:44 -0400

> -----Original Message-----
> From: Bill Denney [mailto:address@hidden On Behalf Of Bill Denney
> Sent: Monday, July 14, 2008 6:54 PM
> To: address@hidden; de Almeida, Valmor F.
> Subject: Re: pngread does not read 12bit gray images
> 
> I assume that you meant to send this reply back to the list.  If not,

Thanks for putting it back. Here are some comments for the record.

> > That is fine. But the user should have the option of doing this 0-1
> scaling from integer to double on his/her own.
> >
> 
> Hopefully it's not actually converting to a double (I would view that
as
> a real problem).

I misunderstood your past e-mails when you mentioned 0-1 scale.
 
> Having done scientific image analysis before, I realize that the work
is
> often low contrast and that it is necessary to keep all information
> intact.  I would argue that putting 774 into a uint16 is not keeping
all
> information intact while putting the bits that make up 774 into the
> leftmost bits of a uint16 is keeping the information intact and
> corresponds to what most image processing/manipulation tools expect.

I guess I care about what happened to my $774; that is, this "tangible,
buying-power quantity" which is represented as

     774 on the decimal base system and,

  0000001100000110 on a big-endian 16-binary base system.

If it happens that it has been bit shifted to the left by 4 instead, I
would certainly welcome that because now

  0011000001100000  represents 

$12384 and that is certainly a financial advantage :)

Thank you for pointing this out. I currently read 12-bit png images as
follows

Y = __magick_read__(filename);

Y = bitshift(Y,-4);

and this matches the info from running imagemagick identify on the file.

imread() should not be used if you have libpng on your system because
this will call a reader that converts the 12-bit data to 8-bit data, and
that is not good.

I have also loaded the file with cinepaint and verified that internally
the pixel values have been shifted to the left by 4 as you mentioned.

Thanks,

--
Valmor

 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]