[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: pngread does not read 12bit gray images
From: |
Søren Hauberg |
Subject: |
Re: pngread does not read 12bit gray images |
Date: |
Sun, 06 Jul 2008 09:25:30 +0200 |
lør, 05 07 2008 kl. 13:41 -0400, skrev de Almeida, Valmor F.:
> 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.
The first thing I would do is to see if ImageMagick can read the file
for you. The current 'imread' function works something like this for png
files
if (have_pngread)
I = pngread (filename)
elseif (have_magickread)
I = __magick_read__ (filename)
else
# try to do it using the 'convert' utility, I think
endif
Since you have 'pngread' installed 'imread' will try to use that. So,
I'd try to use '__magick_read__' directly, i.e.
Y = __magick_read__ ("foo.png");
and see how that works.
Søren
- pngread does not read 12bit gray images, de Almeida, Valmor F., 2008/07/05
- Re: pngread does not read 12bit gray images,
Søren Hauberg <=
- RE: pngread does not read 12bit gray images, de Almeida, Valmor F., 2008/07/11
- RE: pngread does not read 12bit gray images, Søren Hauberg, 2008/07/11
- Re: pngread does not read 12bit gray images, Bill Denney, 2008/07/11
- Re: pngread does not read 12bit gray images, Søren Hauberg, 2008/07/11
- RE: pngread does not read 12bit gray images, de Almeida, Valmor F., 2008/07/11
- Message not available
- Message not available
- Re: pngread does not read 12bit gray images, Bill Denney, 2008/07/14
- RE: pngread does not read 12bit gray images, de Almeida, Valmor F., 2008/07/16
- RE: pngread does not read 12bit gray images, John W. Eaton, 2008/07/16
- RE: pngread does not read 12bit gray images, Søren Hauberg, 2008/07/17
- Re: pngread does not read 12bit gray images, Bill Denney, 2008/07/17