http://www.mathworks.com/matlabcentral/newsreader/view_thread/254135
MATLAB Central Newsreader  Interesting problem with image alpha data
Feed for thread: Interesting problem with image alpha data
enus
©19942014 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Fri, 19 Jun 2009 08:44:02 +0000
Interesting problem with image alpha data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/254135#658693
Michael
I have come across an interesting problem with setting the alpha data for an image, which I can't quite get my head around.<br>
<br>
To explain, consider the following example:<br>
<br>
h1 = figure(1);<br>
h1a = axes('DataAspectRatio', [1 1 1], 'DrawMode', 'fast', 'Parent', h1);<br>
h1b = image('Parent', h1a);<br>
<br>
All works as expect, then:<br>
<br>
set(h1b, 'CData', imread('Peppers.png')); % load a test image.<br>
<br>
This works just as would be expected. So, I then try:<br>
<br>
set(h1b, 'AlphaData', 0.75);<br>
<br>
Which has the right effect. However, this image isn't positioned very nicely within the axes, so I use:<br>
<br>
set(h1a, 'XLim', [1 512], 'YLim', [1 384], 'YDir', 'reverse');<br>
<br>
Which makes everything look nice. But now if I set the alpha data to anything other than 1, the image just dissappears completely. Can anyone tell me what is going wrong here?<br>
<br>
I'm using Matlab R2009a with version 6.3 of the Image Processing toolbox.<br>
<br>
Many thanks!

Tue, 22 Sep 2009 03:05:13 +0000
Re: Interesting problem with image alpha data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/254135#681740
Bill Winter
"Michael " <michael.bennett@lineone.net> wrote in message <h1fj4i$7ln$1@fred.mathworks.com>...<br>
> I have come across an interesting problem with setting the alpha data for an image, which I can't quite get my head around.<br>
> <br>
> To explain, consider the following example:<br>
> <br>
> h1 = figure(1);<br>
> h1a = axes('DataAspectRatio', [1 1 1], 'DrawMode', 'fast', 'Parent', h1);<br>
> h1b = image('Parent', h1a);<br>
> <br>
> All works as expect, then:<br>
> <br>
> set(h1b, 'CData', imread('Peppers.png')); % load a test image.<br>
> <br>
> This works just as would be expected. So, I then try:<br>
> <br>
> set(h1b, 'AlphaData', 0.75);<br>
> <br>
> Which has the right effect. However, this image isn't positioned very nicely within the axes, so I use:<br>
> <br>
> set(h1a, 'XLim', [1 512], 'YLim', [1 384], 'YDir', 'reverse');<br>
> <br>
> Which makes everything look nice. But now if I set the alpha data to anything other than 1, the image just dissappears completely. Can anyone tell me what is going wrong here?<br>
> <br>
> I'm using Matlab R2009a with version 6.3 of the Image Processing toolbox.<br>
> <br>
> Many thanks!<br>
<br>
Has anyone else seen this problem? More importantly, has anyone identified a viable solution?

Tue, 22 Sep 2009 11:49:30 +0000
Re: Interesting problem with image alpha data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/254135#681808
Loren Shure
In article <h99et9$5as$1@fred.mathworks.com>, <br>
whichpart.wwinter.isnotanemail@uci.edu says...<br>
> "Michael " <michael.bennett@lineone.net> wrote in message <h1fj4i$7ln$1@fred.mathworks.com>...<br>
> > I have come across an interesting problem with setting the alpha data for an image, which I can't quite get my head around.<br>
> > <br>
> > To explain, consider the following example:<br>
> > <br>
> > h1 = figure(1);<br>
> > h1a = axes('DataAspectRatio', [1 1 1], 'DrawMode', 'fast', 'Parent', h1);<br>
> > h1b = image('Parent', h1a);<br>
> > <br>
> > All works as expect, then:<br>
> > <br>
> > set(h1b, 'CData', imread('Peppers.png')); % load a test image.<br>
> > <br>
> > This works just as would be expected. So, I then try:<br>
> > <br>
> > set(h1b, 'AlphaData', 0.75);<br>
> > <br>
> > Which has the right effect. However, this image isn't positioned very nicely within the axes, so I use:<br>
> > <br>
> > set(h1a, 'XLim', [1 512], 'YLim', [1 384], 'YDir', 'reverse');<br>
> > <br>
> > Which makes everything look nice. But now if I set the alpha data to anything other than 1, the image just dissappears completely. Can anyone tell me what is going wrong here?<br>
> > <br>
> > I'm using Matlab R2009a with version 6.3 of the Image Processing toolbox.<br>
> > <br>
> > Many thanks!<br>
> <br>
> Has anyone else seen this problem? More importantly, has anyone identified a viable solution?<br>
> <br>
<br>
It works for me in both R2009a and R2009b.<br>
<br>
 <br>
Loren<br>
<a href="http://blogs.mathworks.com/loren">http://blogs.mathworks.com/loren</a>

Tue, 18 May 2010 17:01:24 +0000
Re: Interesting problem with image alpha data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/254135#746484
Carlos
"Michael " <michael.bennett@lineone.net> wrote in message <h1fj4i$7ln$1@fred.mathworks.com>...<br>
> I have come across an interesting problem with setting the alpha data for an image, which I can't quite get my head around.<br>
> <br>
> To explain, consider the following example:<br>
> <br>
> h1 = figure(1);<br>
> h1a = axes('DataAspectRatio', [1 1 1], 'DrawMode', 'fast', 'Parent', h1);<br>
> h1b = image('Parent', h1a);<br>
> <br>
> All works as expect, then:<br>
> <br>
> set(h1b, 'CData', imread('Peppers.png')); % load a test image.<br>
> <br>
> This works just as would be expected. So, I then try:<br>
> <br>
> set(h1b, 'AlphaData', 0.75);<br>
> <br>
> Which has the right effect. However, this image isn't positioned very nicely within the axes, so I use:<br>
> <br>
> set(h1a, 'XLim', [1 512], 'YLim', [1 384], 'YDir', 'reverse');<br>
> <br>
> Which makes everything look nice. But now if I set the alpha data to anything other than 1, the image just dissappears completely. Can anyone tell me what is going wrong here?<br>
> <br>
> I'm using Matlab R2009a with version 6.3 of the Image Processing toolbox.<br>
> <br>
> Many thanks!<br>
<br>
I had a very similar problem and it turned out to be a bug with OpenGL. I tried it on another computer and it just worked! Right now I am trying to update my OpenGL driver.

Wed, 02 Jun 2010 14:40:08 +0000
Re: Interesting problem with image alpha data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/254135#751008
Rene v B
Worked out for me:<br>
rotate the picture a little bit...<br>
<br>
<br>
"Michael " <michael.bennett@lineone.net> wrote in message <h1fj4i$7ln$1@fred.mathworks.com>...<br>
> I have come across an interesting problem with setting the alpha data for an image, which I can't quite get my head around.<br>
> <br>
> To explain, consider the following example:<br>
> <br>
> h1 = figure(1);<br>
> h1a = axes('DataAspectRatio', [1 1 1], 'DrawMode', 'fast', 'Parent', h1);<br>
> h1b = image('Parent', h1a);<br>
> <br>
> All works as expect, then:<br>
> <br>
> set(h1b, 'CData', imread('Peppers.png')); % load a test image.<br>
> <br>
> This works just as would be expected. So, I then try:<br>
> <br>
> set(h1b, 'AlphaData', 0.75);<br>
> <br>
> Which has the right effect. However, this image isn't positioned very nicely within the axes, so I use:<br>
> <br>
> set(h1a, 'XLim', [1 512], 'YLim', [1 384], 'YDir', 'reverse');<br>
> <br>
> Which makes everything look nice. But now if I set the alpha data to anything other than 1, the image just dissappears completely. Can anyone tell me what is going wrong here?<br>
> <br>
> I'm using Matlab R2009a with version 6.3 of the Image Processing toolbox.<br>
> <br>
> Many thanks!

Fri, 12 Jul 2013 21:02:07 +0000
Re: Interesting problem with image alpha data
http://www.mathworks.com/matlabcentral/newsreader/view_thread/254135#908085
marcus
Had the same problem  alpha would apply to isosrufaces fine, but slices through<br>
data were a nogo.<br>
<br>
I updated OpenGL, resintalled MATLAB...and still no luck...but then I ran across this:<br>
=========================<br>
olebowle wrote:<br>
<br>
I had the same issue.<br>
Have a look at: <a href="http://stackoverflow.com/questions/9959">http://stackoverflow.com/questions/9959</a> … theonei<br>
<br>
I simply linked sys/os/glnxa64/libstdc++.so.6.0.13 to /usr/lib/libstdc++.so and now it works fine.<br>
==============<br>
<br>
<br>
This did the job, but I am not exactly sure why.<br>
Good luck.<br>
<br>
<br>
"Michael" wrote in message <h1fj4i$7ln$1@fred.mathworks.com>...<br>
> I have come across an interesting problem with setting the alpha data for an image, which I can't quite get my head around.<br>
> <br>
> To explain, consider the following example:<br>
> <br>
> h1 = figure(1);<br>
> h1a = axes('DataAspectRatio', [1 1 1], 'DrawMode', 'fast', 'Parent', h1);<br>
> h1b = image('Parent', h1a);<br>
> <br>
> All works as expect, then:<br>
> <br>
> set(h1b, 'CData', imread('Peppers.png')); % load a test image.<br>
> <br>
> This works just as would be expected. So, I then try:<br>
> <br>
> set(h1b, 'AlphaData', 0.75);<br>
> <br>
> Which has the right effect. However, this image isn't positioned very nicely within the axes, so I use:<br>
> <br>
> set(h1a, 'XLim', [1 512], 'YLim', [1 384], 'YDir', 'reverse');<br>
> <br>
> Which makes everything look nice. But now if I set the alpha data to anything other than 1, the image just dissappears completely. Can anyone tell me what is going wrong here?<br>
> <br>
> I'm using Matlab R2009a with version 6.3 of the Image Processing toolbox.<br>
> <br>
> Many thanks!