Author Topic: PNG and transparency  (Read 964 times)

0 Members and 1 Guest are viewing this topic.

Offline Felix_k2

  • Major
  • *
  • Posts: 63
  • Australia!!!
PNG and transparency
« on: December 09, 2008, 01:31:57 am »
Hey all,

Okay so ive found myself in love with making interfaces.

Something i have been having trouble with though has been the png and transparency issues. Now i understand that it can work in soldat, but i dont have a clue how to. Ive made an image for my interface and saved it as .png yet it will not display, ive saved it as .BMP but the green spots still show up.

How do you do it? If that was a bit hard to read, basically how do you make interfaces like the interface called Proto, where the images are obviously png, yet it is saved as .BMP and maintains all the transparencys.

~Felix~

Offline jrgp

  • Administrator
  • Flamebow Warrior
  • *****
  • Posts: 5037
Re: PNG and transparency
« Reply #1 on: December 09, 2008, 02:21:15 am »
What you do is this, save your transparent PNG as a .png. Then you just rename the file.png to file.bmp. (note: you don't even need to do this in recent versions of Soldat since they'll just pick up the .png files and use them)

Also, you don't need to use the green spots for transparency in the .png files, just use alpha transparency in whatever image editor you use.
There are other worlds than these

Offline KYnetiK

  • Camper
  • ***
  • Posts: 314
  • Something Else
    • KYnetiK ART
Re: PNG and transparency
« Reply #2 on: December 09, 2008, 02:59:51 am »
Yes, if the png has the correct filename, Soldat will shoose to use that over the bmp.

You only need to use the green as transparency for the bmps, pngs will use the alpha channel.

The thing which annoys me is the Interface Maker only recognises the bmps and not the pngs (if im wrong please enlighten me), so whenever i save my png, i swap the canvas colour to green and export as bmp just so i can quickly preview without booting Soldat (although of course if you have semitransparent areas the green will show through on the preview)
I asked God for a bike, but I know God doesn’t work that way. So I stole a bike and then asked for forgiveness.
_____________
WARNING! This user may use sarcasm and cynicism in a way you are not accustomed to.

[Barret]  /  [saw]
*Shakes Fist*

Offline Mangled*

  • Flagrunner
  • ****
  • Posts: 925
  • Never Wrong
Re: PNG and transparency
« Reply #3 on: December 09, 2008, 09:11:24 pm »
1) Make sure you are placing your .pngs in the Soldat/Interface-gfx folder with the same filenames as the corresponding .bmps - interfaces will not work from the mod directory unfortunately.

2) Don't rename .pngs to .bmps! It is unbelievably bad practice and can cause errors. Just use .png.

3) For transparency you can use alpha or bright green, the green must be the exact shade that Soldat renders as invisible to work, and an alpha masked green will not work.

4) Paint doesn't support alpha transparency, if you're opening transparent images in it you will lose transparency and the colour in the transparent areas will malform.
"There she lusted after her lovers, whose genitals were like those of donkeys and whose emission was like that of horses." - Ezekiel 23:20