[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #41673] imwrite creates bad grayscale images
From: |
Carnë Draug |
Subject: |
[Octave-bug-tracker] [bug #41673] imwrite creates bad grayscale images |
Date: |
Sun, 23 Feb 2014 17:11:25 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20140207 Firefox/24.0 Iceweasel/24.3.0 |
Update of bug #41673 (project octave):
Item Group: Incorrect Result => Regression
Operating System: Microsoft Windows => Any
Summary: imwrite problems with jpg and bmp => imwrite creates
bad grayscale images
_______________________________________________________
Follow-up Comment #1:
I can replicate this problem with the more simple case:
a = repmat (uint8 (0:255), 100, 1);
imshow (a)
imwrite (a, "test.jpg");
b = imread ("test.jpg");
figure;
imshow (b)
The example above shows that the problem happens during imwrite since the jpg
file created is already wrong.
We can also see that the problem happens only with grayscale images since
writing an RGB image creates the image file correctly:
a = repmat (uint8 (0:255), 100, 1, 3);
imwrite (a, "test.jpg");
But I'm unsure if this is a problem in Octave. The reason to believe this is
that Octave does not have format specific code, the code is all the same,
independent of the format chosen. However, if we write the image to a tif or
bmp file, everything is correct. By the way, using imread() to read the RGB
image where all 3 channels are the same, will read a grayscale image. This is
again, because GraphicsMagick will recognize it as such and report a grayscale
image to save memory.
Still, I'm marking this as a regression because apparently (according to the
OP on the mailing list)) Octave was saving the file correctly in 3.2.4 and
3.6.0.
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?41673>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/