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

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

[Octave-bug-tracker] [bug #32986] imread() reads .png with alpha channel


From: anonymous
Subject: [Octave-bug-tracker] [bug #32986] imread() reads .png with alpha channel as an unexpected array format
Date: Sun, 03 Apr 2011 14:02:21 +0000
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:2.0) Gecko/20100101 Firefox/4.0

URL:
  <http://savannah.gnu.org/bugs/?32986>

                 Summary: imread() reads .png with alpha channel as an
unexpected array format
                 Project: GNU Octave
            Submitted by: None
            Submitted on: Sun 03 Apr 2011 02:02:20 PM UTC
                Category: None
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Incorrect Result
                  Status: None
             Assigned to: None
         Originator Name: Jeremy
        Originator Email: 
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 3.2.4
        Operating System: GNU/Linux

    _______________________________________________________

Details:


[img, map, alpha] = imread('transparency_pic.png');

"map" and "alpha" will be empty variables. "img" will be an MxNx2 array (if
grayscale+alpha) or an MxNx4 array (if color+alpha) -- The manual entry for
imread says that "img" should be either MxN (black and white, grayscale) or
MxNx3 (color).

I'm guessing that the data for the alpha channel should be stored in the
"alpha" variable, not as an extra dimension in "img".



img = imread('transparency_pic.png');
imwrite(img, 'copy.png');

...succeeds if _transparency_pic.png_ is color+alpha, but fails if
_transparency_pic.png_ is grayscale+alpha:

error: imwrite: invalid dimensions for truecolor image
error: called from:
error:   /usr/share/octave/3.2.4/m/image/imwrite.m at line 113, column 9



Tested on both Ubuntu 10.10 (repository version, 3.2.4) and Windows 7 (Octave
Forge version, 3.2.4)




    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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