pngread does not read 12bit gray images
de Almeida, Valmor F.
dealmeidav at ornl.gov
Sat Jul 5 12:41:04 CDT 2008
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
PS: Actually I started writing an experimental pngread() for reading
gray images with depths greater than 8 bits. Since this is something I
have not done before, I would appreciate any inputs.
More information about the Help-octave
mailing list