octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #45779] Writing 8-bit grayscale image to bmp f


From: Carnë Draug
Subject: [Octave-bug-tracker] [bug #45779] Writing 8-bit grayscale image to bmp file should write an indexed image
Date: Tue, 25 Aug 2015 16:22:57 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Firefox/31.0 Iceweasel/31.8.0

Follow-up Comment #9, bug #45779 (project octave):

On comment #8 Ian Journeaux said:
> 1. Matlab compatibility. Whether it is explicitly stated in the
documentation or not, given a uint8 array, Matlab writes a 8-bit-per-sample
indexed grayscale image. Specifying the map might be more precise but this is
a place where Matlab compatibilty would be valuable.

Why is this place specially valuable?  It is very simple and much clearer for
the user to be specific what he wants imwrite to write.  If he wants an
indexed image to be written, the user should specify an colormap.  From
Matlab's own imwrite documentation "If A contains indexed image data, you
should additionally specify the map input argument".

>  2. Within Octave, if you write a uint8 array using imwrite, and read the
array back in, it comes back in as an 3 channel RGB array instead of the
original 1 channel array.

If the format does support grayscale images that is to be expected.  This is
not a reason and is perfectly normal. Just like calling imwrite() to save a
image of floating points in the range [0 1] will then be read as uint8 in the
range [0 255].

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?45779>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

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