[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #44118] imwrite saves wrong pixel values into
From: |
Carnë Draug |
Subject: |
[Octave-bug-tracker] [bug #44118] imwrite saves wrong pixel values into jpg file |
Date: |
Thu, 29 Jan 2015 19:47:31 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.4.0 |
Follow-up Comment #3, bug #44118 (project octave):
You are correct, the intensity values on the saved image are much lower.
I think I know what may be happening. When an image in GraphicsMagick is
grayscale, the intensity values are stored in the red channels. This is true
for reading and writing. However, for writing a jpeg grayscale, seems like it
looks into the green and blue channels. These seem to default to zero which is
why it is darker. The whole point of using GraphicsMagick is avoid coder
specific code but seems that it won't do.
Maybe I am wrong about the reason, but the following seems to be a
workaround:
A = uint8 ([0 50 255; 1 3 6])
file = "new.jpg";
imwrite (repmat (A, [1 1 3]), file);
B = imread (file)
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/bugs/?44118>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/