Author Topic: Black Pixel around the sprite  (Read 529 times)  Share 

Black Pixel around the sprite
« on: 07 Jul 2012, 15:45 »
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

Khris

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Black Pixel around the sprite
« Reply #1 on: 07 Jul 2012, 17:15 »
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?
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"

Frito Master

  • 0% Trans-Fat 100% Toxic
    • I can help with animation
    •  
    • I can help with backgrounds
    •  
    • I can help with characters
    •  
    • I can help with voice acting
    •  
Re: Black Pixel around the sprite
« Reply #2 on: 07 Jul 2012, 17:22 »
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.
Your favorite brandname chip friend.

Re: Black Pixel around the sprite
« Reply #3 on: 07 Jul 2012, 17:31 »
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

Re: Black Pixel around the sprite
« Reply #4 on: 07 Jul 2012, 18:15 »
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.

Re: Black Pixel around the sprite
« Reply #5 on: 08 Jul 2012, 08:15 »
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?:




« Last Edit: 08 Jul 2012, 08:25 by steptoe »
I am not dead, I am only sleeping ;)

Arj0n

  • AGS Ate My Baby Sitter!
    • I can help with play testing
    •  
  • Arj0n worked on a game that was nominated for an AGS Award!
Re: Black Pixel around the sprite
« Reply #6 on: 08 Jul 2012, 14:57 »

Re: Black Pixel around the sprite
« Reply #7 on: 08 Jul 2012, 15:52 »
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...

Re: Black Pixel around the sprite
« Reply #8 on: 08 Jul 2012, 16:04 »
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

  • Evil Dark Emperor Death-Kill
    • Lifetime Achievement Award Winner
    •  
    • I can help with play testing
    •  
    • I can help with scripting
    •  
    • I can help with translating
    •  
Re: Black Pixel around the sprite
« Reply #9 on: 08 Jul 2012, 18:31 »
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.
http://whathaveyoutried.com/

The other day on yahoo answers:
"Can you print colored images with black ink? If so tell me how please Thanx Kimberly"