[PNG] Alpha channel is too dark

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[PNG] Alpha channel is too dark

lzaiats
Hi,

I am loading a PNG with alpha channel targeting iPhone and the PNG image looks too dark.

Any idea?

Thanks

LZ
Reply | Threaded
Open this post in threaded view
|

Re: [PNG] Alpha channel is too dark

graham
Graham is out of the office until Monday 11th of April.



--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: [PNG] Alpha channel is too dark

Gamehaxe
In reply to this post by lzaiats
Hi,
I think XCode is "premultiplying" the alpha.  There is a flag to stop it  
(info.plist ?)
but I can't remember off the top of my head.  This should be put into NME  
at some stage.

Hugh

> Hi,
>
> I am loading a PNG with alpha channel targeting iPhone and the PNG image
> looks too dark.
>
> Any idea?
>
> Thanks
>
> LZ
>
> --
> View this message in context:  
> http://haxe.1354130.n2.nabble.com/PNG-Alpha-channel-is-too-dark-tp6250582p6250582.html
> Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: [PNG] Alpha channel is too dark

lzaiats
Hi Hugh!

Thank you, i am right now searching in Google, but i still didn't found anything about it :(

Thanks!

LZ
Reply | Threaded
Open this post in threaded view
|

Re: [PNG] Alpha channel is too dark

singmajesty
When I was adapting NME for Palm webOS, I had a problem where the alpha  
didn't seem to look quite right. I later discovered that they provide a  
video layer underneath C applications for convenience, so you can play  
videos easily without handling the codecs and libraries yourself. As a  
result, though, I needed to add a flag to hide this layer, so that my  
transparencies would not be multiplied against black, resulting in dark  
fringes.

I am not sure if this is similar to what may be occuring with your iPhone  
project?



On Thu, 07 Apr 2011 10:17:45 -0700, lzaiats  
<[hidden email]> wrote:

> Hi Hugh!
>
> Thank you, i am right now searching in Google, but i still didn't found
> anything about it :(
>
> Thanks!
>
> LZ
>
> --
> View this message in context:  
> http://haxe.1354130.n2.nabble.com/PNG-Alpha-channel-is-too-dark-tp6250582p6250842.html
> Sent from the Haxe mailing list archive at Nabble.com.
>


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: [PNG] Alpha channel is too dark

lzaiats
I really dont know what is causing this behaviour...

Hugh, ive tried to use the IPHONE_OPTIMIZE_OPTIONS=-skip-PNGs or the .ppng trick without success. Also ive cleaned my buid before trying it... No luck at all...

Joshua, is this "video layer" from NME or from webOS Framework?

Thanks,

LZ
Reply | Threaded
Open this post in threaded view
|

Re: [PNG] Alpha channel is too dark

singmajesty
The video layer was specific to webOS, but it is possible that Apple may  
have something similar, or may be doing something else which causes  
textures to be multiplied against black


On Thu, 07 Apr 2011 11:31:29 -0700, lzaiats  
<[hidden email]> wrote:

> I really dont know what is causing this behaviour...
>
> Hugh, ive tried to use the IPHONE_OPTIMIZE_OPTIONS=-skip-PNGs or the  
> .ppng
> trick without success. Also ive cleaned my buid before trying it... No  
> luck
> at all...
>
> Joshua, is this "video layer" from NME or from webOS Framework?
>
> Thanks,
>
> LZ
>
> --
> View this message in context:  
> http://haxe.1354130.n2.nabble.com/PNG-Alpha-channel-is-too-dark-tp6250582p6251117.html
> Sent from the Haxe mailing list archive at Nabble.com.
>


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: [PNG] Alpha channel is too dark

lzaiats
Hmmm... I really dont think so....

Hugh, any idea?

LZ
Reply | Threaded
Open this post in threaded view
|

Re: [PNG] Alpha channel is too dark

Gamehaxe
In reply to this post by lzaiats
Hi,
Yes, that was the one I was thinking of.
It is probably worth finding out if the data is wrong or the rendering is  
wrong.
You could try reading a particular pixel from the BitmapData, and you
could try rendering a rectangle with known alpha and see whay you get.

Hugh

> I really dont know what is causing this behaviour...
>
> Hugh, ive tried to use the IPHONE_OPTIMIZE_OPTIONS=-skip-PNGs or the  
> .ppng
> trick without success. Also ive cleaned my buid before trying it... No  
> luck
> at all...
>
> Joshua, is this "video layer" from NME or from webOS Framework?
>
> Thanks,
>
> LZ
>
> --
> View this message in context:  
> http://haxe.1354130.n2.nabble.com/PNG-Alpha-channel-is-too-dark-tp6250582p6251117.html
> Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: [PNG] Alpha channel is too dark

lzaiats
Hmmm.... I will do some tests... Ive already tried to change come bits on OpenGLContext.cpp from NME to see if the problem was the "premultiplied" alpha:

FROM
glColor4f(t.redMultiplier,t.greenMultiplier,t.blueMultiplier,t.alphaMultiplier);

TO
glColor4f(t.redMultiplier/t.alphaMultiplier,t.greenMultiplier/t.alphaMultiplier,t.blueMultiplier/t.alphaMultiplier,t.alphaMultiplier);

But i got no success :(

I really dont know where to try more changes to get this alpha channel working properly... I am getting crazy ;)

Thanks,

LZ