Problems with Alpha channels on hard edged images
Moderator: George Gilbert
Forum rules
Please read the Forum rules and policies before posting.
Please read the Forum rules and policies before posting.
- Gambit37
- Should eat more pies
- Posts: 13718
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Problems with Alpha channels on hard edged images
RTC can't handle rescaling images that have an alpha channel AND hard edges.
The original Troll image is this, it has hard edges for the troll and soft edges for his shadow:
However, this combination causes problems with distance rescaling:
It's fine if you just use 1-bit transparency and a hard edged shadow, but then you can't do semi-transparency It's also fine if the image in question already has soft, semi transparent edges.
The original Troll image is this, it has hard edges for the troll and soft edges for his shadow:
However, this combination causes problems with distance rescaling:
It's fine if you just use 1-bit transparency and a hard edged shadow, but then you can't do semi-transparency It's also fine if the image in question already has soft, semi transparent edges.
- linflas
- My other avatar is gay
- Posts: 2445
- Joined: Tue Nov 04, 2003 9:58 pm
- Location: Lille, France
- Contact:
Re: Problems with Alpha channels on hard edged images
I noticed that problem too. Some PNGs are correct, some are not
"The only way out is another way in." Try Sukumvit's Labyrinth II
-
- Neophyte
- Posts: 7
- Joined: Wed Nov 05, 2008 7:38 pm
Re: Problems with Alpha channels on hard edged images
That coming from GIMP.
i noticed that too with picture i had filled with purple color before to cut it and replace by a transparent color.
So, if you want to destroy the color around the monster, fill the transparent color by the black color make a save picture, reload picture and cut the black color for transparent and save.
Now the color around have disapear.
i noticed that too with picture i had filled with purple color before to cut it and replace by a transparent color.
So, if you want to destroy the color around the monster, fill the transparent color by the black color make a save picture, reload picture and cut the black color for transparent and save.
Now the color around have disapear.
- Lord_BoNes
- Jack of all trades
- Posts: 1064
- Joined: Mon Dec 01, 2008 12:36 pm
- Location: Ararat, Australia.
Re: Problems with Alpha channels on hard edged images
It appears that it only affects 1-2 pixels out so... paint black onto the background, in the problematic areas.
1 death is a tragedy,
10,000,000 deaths is a statistic.
- Joseph Stalin
Check out my Return to Chaos dungeon launcher
And my Dungeon Master Clone
- Gambit37
- Should eat more pies
- Posts: 13718
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Problems with Alpha channels on hard edged images
What background? The background is transparent. If you start painting around the monster, how does this help? You're just shifting the problem area to a couple of pixels further out.
I'm not sure what paladin is talking about as he mentions the power pink, so I guess he's talking about 8 bit images which can't have alpha channels -- this problem only affects images with an alpha channel.
I'm not sure what paladin is talking about as he mentions the power pink, so I guess he's talking about 8 bit images which can't have alpha channels -- this problem only affects images with an alpha channel.
- Lord_BoNes
- Jack of all trades
- Posts: 1064
- Joined: Mon Dec 01, 2008 12:36 pm
- Location: Ararat, Australia.
Re: Problems with Alpha channels on hard edged images
A suggestion: can you put a soft shadow around him? You could have one version of the graphic for levels where it has a dark fade-out (the above image for example), and one version of it for brighter levels (where it would be far less noticable, but a black border would stand out).
1 death is a tragedy,
10,000,000 deaths is a statistic.
- Joseph Stalin
Check out my Return to Chaos dungeon launcher
And my Dungeon Master Clone
- Gambit37
- Should eat more pies
- Posts: 13718
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Problems with Alpha channels on hard edged images
Yes, that might work.
I think the problem is that I'm using "x2" images with no intermediate pixel between each block of doubled pixels. (This is what happens when you double up images from the original DM resolution). Adding a slight semi-transparent shadow or "glow" around the image would solve this -- I'll give it a go.
I was trying to keep file sizes down by using as few semi-trans pixels as possible, so this technique will bloat the filesizes somewhat, but might be a good compromise. Thanks for the suggestion.
I think the problem is that I'm using "x2" images with no intermediate pixel between each block of doubled pixels. (This is what happens when you double up images from the original DM resolution). Adding a slight semi-transparent shadow or "glow" around the image would solve this -- I'll give it a go.
I was trying to keep file sizes down by using as few semi-trans pixels as possible, so this technique will bloat the filesizes somewhat, but might be a good compromise. Thanks for the suggestion.
- Gambit37
- Should eat more pies
- Posts: 13718
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Problems with Alpha channels on hard edged images
Cool, tried that and it works perfectly. In Photoshop I added a 4px black Glow at 20% opacity around the Troll -- this is almost imperceptible in game and fixes the problem with ugly rescaling. It does mean the filesizes will be a lot bigger and consume more memory, but we're only talking tens of Kb difference so I hope I won't be an issue (I want this to run well on older machines.)
- Lord_BoNes
- Jack of all trades
- Posts: 1064
- Joined: Mon Dec 01, 2008 12:36 pm
- Location: Ararat, Australia.
Re: Problems with Alpha channels on hard edged images
Good work. Can you post some screenies of the troll in various wallsets (DMI, DMII, the one above, etc)??? Please....
Last edited by Lord_BoNes on Sat Jan 02, 2010 7:52 pm, edited 2 times in total.
1 death is a tragedy,
10,000,000 deaths is a statistic.
- Joseph Stalin
Check out my Return to Chaos dungeon launcher
And my Dungeon Master Clone
- Gambit37
- Should eat more pies
- Posts: 13718
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Problems with Alpha channels on hard edged images
Not really, no. He's for use in my custom game. You can get the original uncoloured Troll from DungeonHack or EOB3 asset zips -- both available here:
Dungeon Making Resources
Dungeon Making Resources
- Lord_BoNes
- Jack of all trades
- Posts: 1064
- Joined: Mon Dec 01, 2008 12:36 pm
- Location: Ararat, Australia.
Re: Problems with Alpha channels on hard edged images
I've often been called a "great problem solver" (for those who have played Duke Nukem 3D, it almost never takes me more than a minute or two to crack a lock that is basically 4x4 block of binary, shootable, toggle switches that requires a SPECIFIC combination). So, feel free to PM me if you any issues with RTC. Most of the time, I'll just sit here until I get it kickin' perfectly. It's just my method of solving problems.
1 death is a tragedy,
10,000,000 deaths is a statistic.
- Joseph Stalin
Check out my Return to Chaos dungeon launcher
And my Dungeon Master Clone
- Lord_BoNes
- Jack of all trades
- Posts: 1064
- Joined: Mon Dec 01, 2008 12:36 pm
- Location: Ararat, Australia.
Re: Problems with Alpha channels on hard edged images
I being serious (for once, hehehe ) if you have issues trying to do something in RTC, feel free to just PM me about it. To be honest, it'd save me time.
1 death is a tragedy,
10,000,000 deaths is a statistic.
- Joseph Stalin
Check out my Return to Chaos dungeon launcher
And my Dungeon Master Clone
- Gambit37
- Should eat more pies
- Posts: 13718
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Problems with Alpha channels on hard edged images
It was weird, your last post just seemed to be totally unrelated to this thread, like you meant to post it on one of the other RTC mechanics threads or something.
- Lord_BoNes
- Jack of all trades
- Posts: 1064
- Joined: Mon Dec 01, 2008 12:36 pm
- Location: Ararat, Australia.
Re: Problems with Alpha channels on hard edged images
Sorry dude. I blame sleep-deprivation... that's my excuse, and I'm sticking to it!
1 death is a tragedy,
10,000,000 deaths is a statistic.
- Joseph Stalin
Check out my Return to Chaos dungeon launcher
And my Dungeon Master Clone
-
- Neophyte
- Posts: 7
- Joined: Wed Nov 05, 2008 7:38 pm
Re: Problems with Alpha channels on hard edged images
no you havn't understand me...
when you draw sometime you fill probably the background with a color by accident. Arround your monster, you have grey color.
That mean you have filled your back ground with grey color at a moment and you cut it for make it transparent.
When you save, that do this! you get this color around the monster. It's probable a save of different font of gimp.
So for repair you need to fill it with black color and change into transparent again and save it for repair your picture.
for don't lost your job, you can use magic pen and work with reversed selection.
when you draw sometime you fill probably the background with a color by accident. Arround your monster, you have grey color.
That mean you have filled your back ground with grey color at a moment and you cut it for make it transparent.
When you save, that do this! you get this color around the monster. It's probable a save of different font of gimp.
So for repair you need to fill it with black color and change into transparent again and save it for repair your picture.
for don't lost your job, you can use magic pen and work with reversed selection.
- Gambit37
- Should eat more pies
- Posts: 13718
- Joined: Wed May 31, 2000 1:57 pm
- Location: Location, Location
- Contact:
Re: Problems with Alpha channels on hard edged images
Right, I see what you mean. But I don't create images like this, I work on fully transparent images with no background: your solution doesn't apply to images created in this way. You're talking about something completely different.