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: Bengt-Arne Fjellner
Subject: Re: pngread does not read 12bit gray images
Date: Thu, 10 Jul 2008 19:23:30 +0200
User-agent: Microsoft-Entourage/12.11.0.080522



On 2008-07-05 7:41 PM, "de Almeida, Valmor F." <address@hidden> wrote:

> 
> Hello,
> 
> I am using imread() to read 12-bit png images. The result of
> 
> Y = imread("foo.png");
> class(I);
> 
> is uint16. However the max and min values of Y are not correct. I
> tracked the problem down to this section of pngread.cc in the
> octave-forge package image-1.06
> 
>   // For now, use 8-bit only
>   if (bit_depth == 16) {
>       png_set_strip_16(png_ptr);
>   }
> 
> Is there a simple fix for this so that I do get all gray values into the
> matrix Y? The issue here is that after the 8-bit strip, the image loses
> critical information; in particular contrast details that are important
> for the image processing code I am writing.
> 
> Thanks,
> 
> --
> Valmor
I'm working on one to:
Download and try:
http://pinus.tt.ltu.se/~baf/pngread.cc
The test for endianness of the machine should be done during compilation but
I haven't figured out how.

And if it seems to work just include it in the distro.







reply via email to

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