Sign in to follow this  
jor1980

Creation of png files with alpha layer from directx

Recommended Posts

jor1980    152
Hi i would like to know if it is possible to create png files with alpha layer from a texture in directx or slimdx, I am exporting textures as png as using basemesh.tofile but the textures which originally was dds only exports the part of the dds that in the alpha channel is white, and the new png doesn´t have alpha layer

Share this post


Link to post
Share on other sites
jor1980    152
sorry i think i didn´t express myself well

Waht i try to mean is that i have dds textures allocated in directx.direct3d.textures, this dds has an alpha channel and when i try to save to a png file this texture i lost the alpha channel and it saves the texture like a png without alpha layer?

How can i conserve the alpha layer when i save dds texture to png using texture.tofile?

Share this post


Link to post
Share on other sites
Evil Steve    2017
Quote:
Original post by jor1980
the original texture is a dxt5 with alpha channel and i am trying to save it as png.Aren´t there png with alpha channel?
PNG has alpha, yes. But the IDirect3DTexture9 you loaded the DXT5-format into might not. If you load an image with alpha into a texture that has no alpha, you'll lose the alpha information.

Share this post


Link to post
Share on other sites
Evil Steve    2017
Quote:
Original post by jor1980
Thank's for your answer, could i save it as png with alpha in anyway?or it is impossible
Nope, the alpha channel is lost. Just as if you take a 32 byte file and save the first 24 bytes it's not possible to get the missing 8 bytes back.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this