PNG importing issue

Started by Lucky, Sun 22/04/2007 18:13:16

Previous topic - Next topic

Lucky

All sudden, I've started experiencing this weird issue when importing sprites.

http://koti.phnet.fi/ripara/Lucky/clitch.jpg

That is, I get these ugly black and brown things where there's supposed to be transparency. Any idea what simple thing is causing this?

CodeJunkie

How very odd.  Have you got something weird going on with palettes in your png - maybe if colours are being reduced they're being converted to those weird shapes.  Check that the RGB of your background is the same throughout, and is this happening to all sprites of all sizes, colours and only pngs?  If you upload the original png other people can try importing it too. 

Gilbert

Can you post the original PNG image here for us to investigate on the problem ?

GarageGothic

I get this all the time too, and it IS very annoying, but for me it only shows up in the editor. Does it actually appear like this in the game, or just in the editor?

Edit: Oh yeah, this is only for 32-bit sprites using alpha channels, right?

Gilbert

If that just show up like this in the editor, the reason is because the editor does not render alpha blended sprites, so they should be alright when you test your game (test it first).
The reason is, those "transparent" pixels were actually painted with struff, but their transparencies are all set to 100% so they won't show up in a properly rendered environment.

Anyway, since I don't know what programme you used to save your sprites as PNGs, but some programmes have the option of discarding the colours of pixels set to 100% transparent while saving (at least the GIMP can do it), so use that option if available and the sprites on't be that ugly even rendered in non-alpha support environments (it may help a bit in saving disk space too).

Lucky


Gilbert

Just checked, that's exactly the problem I described, I bet you're probably using 16-bit colour mode, in that case alpha channels are NOT supported, so you need to save your PNGs without Alpha channels and choose one SOLID colour as transparency if you need to use 16-bit.

If you import it into a 32-bit game the sprite renders correctly in both the editor and the game (for me at least).


Lucky

Nope, checked it and I certainly am using 32-bit palette. Now I'm even more confused.

Ashen

So it comes back to what GarageGothic said a while back (and Gilbot echoed, and you haven't replied to):
Quote
I get this all the time too, and it IS very annoying, but for me it only shows up in the editor. Does it actually appear like this in the game, or just in the editor?

If it looks OK in-game, don't worry about it. This is a known (and documented - e.g. HERE) issue with the Editor having a problem displaying alpha transparency and won't affect the game itself. I've also tried importing the png you linked to, and this seems to be the case - looks like clitch.jpg in the editor, fine in the game.
I know what you're thinking ... Don't think that.

SMF spam blocked by CleanTalk