Black Pixel around the sprite

Started by Caracal, Sat 07/07/2012 15:45:10

Previous topic - Next topic

Caracal

Hey everyone.
I got a real problem now and this does not result primarily out of my lacking scripting-knowledge.
https://dl.dropbox.com/u/87581860/Black%20pixel.png
I was working on a new game and I noticed that there is a nasty black-pixel area around the sprites…
The sprite files are PNG and the black area is actually empty. I have worked on several projects now
and everything worked just fine. This is the first time that something like this occurs.
I am desperate, what might the problem be? Did anyone ever have the same issue?
Is there a way to remove this problem?

Khris

There seems to be something wrong with the png files themselves; it doesn't look like an AGS-related error.
Could you upload one of the sprites for us to take a look at?

By default, AGS makes the color transparent it finds in the sprite's top left corner, did you make sure the sprites' background uses only one color?

EchosofNezhyt

It looks like your sprite's alpha is all wonky. Make sure that the area around the sprite is all one color or just delete the area around the sprite and import and click leave as is.

I accidentally did this before with a gui.

Alan v.Drake

Check that you're correctly saving the png with alpha channels and that the game project is in 32 bit. When you import the image it should ask you if preserve the alpha channel, if so click yes, if not one of those conditions is not meet.

- Alan

Kastchey

I encountered this issue a few times while importing graphics in PNG format. For some reason, AGS sometimes incorrectly reads color values in PNG and only PNG (as far as I noticed, at least) even if the image has no alpha channel. Try converting your PNG frames to GIF, it always does the trick for me if this problem occurs.

steptoe

#5
Is it meant to be this?:



Also, the edging was not tight enough to the sprite which gives those nasty pixel edges.

Saved as PNG.

rather than this?:




It's not over until the fat lady sings..

arj0n


Caracal

Quote from: Khris on Sat 07/07/2012 17:15:43
There seems to be something wrong with the png files themselves; it doesn't look like an AGS-related error.
Could you upload one of the sprites for us to take a look at?
https://dl.dropbox.com/u/87581860/walk%20front%203.png
This is the plain PNG file.
I usually keep the backgrounds empty, this is the major advantage to JPG (besides some others). The strange thing is that i importet this exact PNG into another game project i have been working on, and it worked perfect there. Maybe i screwed something in the global skript (trying to work on a way to get the "ultimate cursor" untill you gave me your code) and thereby i damaged something. I dont know but its really strage because in other game projects... AGS doesent do this with this particular PNG.
But the background of this file is empty. Not even white just plain empty and this usually worked, so far...

Caracal

Quote from: Kastchey on Sat 07/07/2012 18:15:49
I encountered this issue a few times while importing graphics in PNG format. For some reason, AGS sometimes incorrectly reads color values in PNG and only PNG (as far as I noticed, at least) even if the image has no alpha channel. Try converting your PNG frames to GIF, it always does the trick for me if this problem occurs.
Well i did this and now it works. But just saving them as Gif wont solve the problem. I still wonder why ags will accept the same PNG files in other projects but not in this particular one...
Its strange. But thanks for the hint though now everything works and i can go on! :-)

Khris

The important difference would be the game's color depth. 8bit limits the game to 256 colors, 16bit is standard and 32bit is needed to use alpha-channels.

SMF spam blocked by CleanTalk