octave-maintainers
[Top][All Lists]
Advanced

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

Re: imread (repost)


From: John W. Eaton
Subject: Re: imread (repost)
Date: Tue, 05 Aug 2008 23:05:35 -0400

On  5-Aug-2008, Thomas L. Scofield wrote:

| 
| In Octave:
| 
| octave:4> im = imread("magnolia.png");
| octave:5> whos im
| Variables in the current scope:
| 
|    Attr Name        Size                     Bytes  Class
|    ==== ====        ====                     =====  =====
|         im        480x640x4                1228800  uint8
| 
| Total is 1228800 elements using 1228800 bytes
| 
| octave:6> max(max(im(:,:,4)))
| ans = 247
| octave:7> min(min(im(:,:,4)))
| 
| 
| octave:8> [im,map,alpha] = imread("magnolia.png");
| octave:9> whos im map alpha
| Variables in the current scope:
| 
|    Attr Name        Size                     Bytes  Class
|    ==== ====        ====                     =====  =====
|         im        480x640x4                1228800  uint8
|         map         0x0                          0  double
|         alpha       0x0                          0  double
| 
| Total is 1228800 elements using 1228800 bytes
| 
| 
| In Matlab:
| 
|  >> im = imread('magnolia.png');
|  >> whos im
|    Name        Size              Bytes  Class    Attributes
| 
|    im        480x640            307200  uint8

Hmm.  that seems like a bug.  Or is it documented somewhere?  And waht
version of Matlab are you using?  Can you send the image to me?

|  >> [im, map, alpha] = imread('magnolia.png');
|  >> whos im map alpha
|    Name         Size              Bytes  Class     Attributes
| 
|    alpha        0x0                   0  double
|    im         480x640            307200  uint8
|    map        250x3                6000  double
| 
| 
| For this same image, here is the output of the GraphicsMagick shell  
| command  "gm identify -verbose magnolia.png":
| 
| Image: /Users/scofield/images/generic/magnolia.png
|    Format: PNG (Portable Network Graphics)
|    Geometry: 640x480
|    Class: DirectClass
|    Type: true color with transparency
|    Depth: 8 bits-per-pixel component
|    Channel Depths:
|      Red:      8 bits
|      Green:    8 bits
|      Blue:     8 bits
|      Opacity:  8 bits

OK.  First, it seems that imread needs some changes so that when im
and map are requested, we return the image in that format instead of
just ignoring those outputs.

Given that Matlab doesn't seem to handle alpha in this case, I'm not
sure what is best (whatever we do, there is some chance that we will
have to change later for compatibility reasons).

jwe


reply via email to

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