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

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

[Octave-bug-tracker] [bug #54309] Internal transparent area of png image


From: Rik
Subject: [Octave-bug-tracker] [bug #54309] Internal transparent area of png image is loaded as border color by imread
Date: Fri, 13 Jul 2018 16:45:11 -0400 (EDT)
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

Update of bug #54309 (project octave):

                  Status:                    None => Confirmed              
                 Release:                   4.2.1 => dev                    
        Operating System:       Microsoft Windows => Any                    
                 Summary: Internal transparent area of png image is loaded as
border color => Internal transparent area of png image is loaded as border
color by imread

    _______________________________________________________

Follow-up Comment #2:

Confirmed.  The question is whether this is something that the GraphicsMagick
libary is doing, or is it something that Octave is doing?

Note that the extra information about the alpha channel is present in the
third output argument.


help imread
[IMG, MAP, ALPHA] = imread (FILENAME)


Because there is no color associated with pixels in the center of the image
(they are transparent) their color channel value really can be anything.  In
this case they were set to red.  If I apply the alpha layer to the image I get
the desired result.


octave:2> [I,M,A] = imread ("hearts_o.png");
octave:3> size (I)
ans =

   424   341     3

octave:4> size (A)
ans =

   424   341

octave:5> A2 = repmat (A, [1 1 3]);
octave:6> I2 = I;
octave:7> I2(! A2) = 0;
octave:8> imshow (I2)


Maybe we should change Octave so that if no alpha argument is requested, then
the alpha blending is automatically applied to IMG.

I confirmed as well that this is only an issue with images with an alpha
channel.  I took the original image and removed the alpha channel using GIMP
and it loads correctly.

Adding Carne to the CC list since he understands image issues.




    _______________________________________________________

Reply to this item at:

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

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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