Jump to content

Transparent PNG's


Recommended Posts

Ive noticed a anoying Bug with Transparent PNG's

They have Horrid White Lines that show up on the Borders of them (ONLY IN GAME)

Here is an image...

nav.png

as you can see, there is nothing wrong with the image.

Here is what it does in MTA:

whiteline.jpg

also, heres a Full Screenshot Showing its done the same thing around the URL image in the Top Right (Its harder to see because its Daytime in game)

http://files.potholestudios.com/mta/logo.jpg

Whats the go with this? and is there a Different way to Save the .PNG files? (not that i think Photoshop is the cause)

Link to comment

Really nice work!

How did you do that? Might be perfect in my CS gamemode ^^

Did you try to use a jpg file instead of png?

I also use Photoshop. As far as i know causes Photoshop problems with bmp files.. But you have png. I had same problem yesterday, when i tried to make a little image representing the armor thing in CS.. The Health Image worked perfectly (also png). Did you resize the Working area in PS? I did that with the armor picture. Try to cut the (now visible outer )border away and test again.

Link to comment

It's not that. Besides, JPEG does not support transparency. When I was working in OGRE3D transparent PNG's had the same "white border" problem. And it seems to be known in other graphics engines as well. I did some research but never really found the solution. Some said it was due to the fact that Photoshop does not save the alpha channel. But the problem remained even after I saved the image as bitmap with alpha channel and converted it to PNG-24 (Photoshop defaults to PNG-8 red.).

EDIT: typo, meant to say "does not save the alpha channel" instead of "does save" :| .

Edited by Guest
Link to comment

Well, im going to try a few other ideas soon, (Cutting off a Picl from the oppisite sides, so the transparancy does not go all the way to the edges)

As i have the strange feeling that thats the cause, not sure tho. iil get back.

As The Race Spectate mode, with the arrows > Dont show the lines, even tho they are PNG, and the only difference is, The image inside the PNGS for the arrows, does not go all the way to the edges.

Link to comment

Is the image in your post the actual one in use ? It has dimensions 361px × 305px ? If so, try padding the image out to 512x512. Graphics cards are designed to work best/accurately with textures that are square and sized in powers of 2 e.g. 128x128,256x256. Sometimes, when they're not, the hardware will interpolate the data incorrectly during scaling and give you errors like this. I had the same problem embedding a logo bottom right in my mod - moving the texture up to 512x512 solved the issue.

Link to comment

Yay, tma could be right...

I wondered why my transparent 32x32 icon was clear and the other 56 x 43 icon had a white boarder.

Dazza Jay: Could you tell me how you did that? I mean to have playerblips and a new radar skin? Would be very nice. But if you would say "No, my idea, my invention", i mean sure. I would do the same

Link to comment

Sure enough, changing it to 512x512 was the issue.

Now, as for how to make your own radar, its really easy.

Its an entire clientside script, hel, iil even give you that.

function displayMainPlate() 
  RadarPlate = guiCreateStaticImage(0, 0.7458334, 0.225625, 0.2541666, 'radar.png', true, nil) 
  guiMoveToBack( RadarPlate ) 
end 
  
addEventHandler("onClientResourceStart",getResourceRootElement(getThisResource()),displayMainPlate) 

all you need now is a radar.png (Dont use mine) Here is how i made it.

Got a 1600x1200 screenshot of the game, and cut the screenshot down so all i had left was the bottom corner of it at a sise of 361 x 305.

then using a new layer in photoshop, add your design in, fitting it around the radar. (Remember, what you see thru the layer in Photoshop is how it will look in game)

Once you have done, Hide the background layer (of the original game screenshot) then change the Image sise all the way to 512x512 save it as a .png (radar.png) add it to the resource, and run it.

Link to comment
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...