0.91 bad/dirty alpha vs 0.48 good/fine alpha.

Post questions on how to use or achieve an effect in Inkscape.
toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

0.91 bad/dirty alpha vs 0.48 good/fine alpha.

Postby toxigames » Tue Sep 08, 2015 12:09 am

I am using the program Game Maker to create a game using images created with Inkscape. For some reason alpha edges on some images created using 0.91 becomes "dirty", jagged and dark colored, when scaling them, while this has never happened with images created with 0.48 (as far as I know).

Below I linked to two images in my Dropbox, they are unaltered and in their original export size from Inkscape. These are created from the exact same object. I created it in 0.91 and exported to a png that then displays dirty edge but only when scaling the image. Then I exported to png from a 0.48 window instead and this image does NOT show dirty edges when scaling the image! What is the difference between these two images?

0.91(dirty edges on scaling): https://www.dropbox.com/s/v570q8seetnvw ... s.png?dl=0
0.48(no dirty edges on scaling): https://www.dropbox.com/s/9wfhkdcfz8sb1 ... s.png?dl=0

Also below is two screenshots of my game when scaling the images up, using the 0.91 picture on the first image, and 0.48 picture on the second. As you can see on the 0.91 there is black/dirty edges while 0.48 image has fine/normal edges.

What is causing this? Is it a bug that was introduced with 0.91 that somehow sometimes does not create a proper alpha channel? And how do I fix this other than export from 0.48?

0.91 in-game screenshot (dirty edges on scaling):
Image

0.48 in-game screenshot (no dirty edges on scaling):

Image

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: 0.91 bad/dirty alpha vs 0.48 good/fine alpha.

Postby brynn » Tue Sep 08, 2015 2:33 am

I'm not sure what you mean by "alpha edges". But I see absolutely no difference between those images in dropbox (viewed through Firefox).

There was a change in how raster images are displayed in Inkscape, with 0.91. But it doesn't sound like you're displaying raster images in Inkscape. It sounds like you're exporting PNGs using Export PNG Image dialog.

Have you changed the anti-aliasing option? Document Properties > Page tab > Display > Use Anti-Aliasing?

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: 0.91 bad/dirty alpha vs 0.48 good/fine alpha.

Postby ~suv » Tue Sep 08, 2015 3:06 am

toxigames wrote:Below I linked to two images in my Dropbox, they are unaltered and in their original export size from Inkscape. These are created from the exact same object. I created it in 0.91 and exported to a png that then displays dirty edge but only when scaling the image. Then I exported to png from a 0.48 window instead and this image does NOT show dirty edges when scaling the image! What is the difference between these two images?

One difference between the two bitmap exports is the color of the fully transparent pixels (empty background): they are fully transparent white in the PNG exported with Inkscape 0.48; fully transparent black in the PNG exported with Inkscape 0.91.

Attempts to reproduce the "dirty edges" in GIMP 2.9 (adding cloudy background, up- or downscale the image (before or after flattening); with different interpolation methods (None, Linear, Cubic, NoHalo, LoHalo)) failed - the results were as expected, without unwanted artifacts.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: 0.91 bad/dirty alpha vs 0.48 good/fine alpha.

Postby ~suv » Tue Sep 08, 2015 3:21 am

~suv wrote:One difference between the two bitmap exports is the color of the fully transparent pixels (empty background): they are fully transparent white in the PNG exported with Inkscape 0.48; fully transparent black in the PNG exported with Inkscape 0.91.

… or the same information stated differently (taken from ImageMagick's identify output):
  • 048_no_dirty_edges.png
    Alpha: srgba(255,255,255,0) #FFFFFF00
    Background color: white
  • 091_dirty_edges.png
    Alpha: none #00000000
    Background color: white
Attachments
ImageMagick-Identify-output.zip
ImageMagick's identify output (2 text files in Zip archive)
(2.82 KiB) Downloaded 150 times

toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

Re: 0.91 bad/dirty alpha vs 0.48 good/fine alpha.

Postby toxigames » Tue Sep 08, 2015 4:56 am

~suv wrote:One difference between the two bitmap exports is the color of the fully transparent pixels (empty background): they are fully transparent white in the PNG exported with Inkscape 0.48; fully transparent black in the PNG exported with Inkscape 0.91.

Attempts to reproduce the "dirty edges" in GIMP 2.9 (adding cloudy background, up- or downscale the image (before or after flattening); with different interpolation methods (None, Linear, Cubic, NoHalo, LoHalo)) failed - the results were as expected, without unwanted artifacts.


From your post I understand that for whatever the real reason my game development program Game Maker shows black jagged edges on semi transparent (anti-aliased) edges when the PNG is exported with fully transparent black. That must be it then. Is there some way to make Inkscape 0.91 export the PNG's with fully transparent white instead of black?

toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

Re: 0.91 bad/dirty alpha vs 0.48 good/fine alpha.

Postby toxigames » Thu Oct 15, 2015 12:07 am

~suv wrote:
~suv wrote:One difference between the two bitmap exports is the color of the fully transparent pixels (empty background): they are fully transparent white in the PNG exported with Inkscape 0.48; fully transparent black in the PNG exported with Inkscape 0.91.

… or the same information stated differently (taken from ImageMagick's identify output):
  • 048_no_dirty_edges.png
    Alpha: srgba(255,255,255,0) #FFFFFF00
    Background color: white
  • 091_dirty_edges.png
    Alpha: none #00000000
    Background color: white


~suv, If you have the time to it can I ask you to copy paste the command line you give ImageMagick to print the info you found? I'd like to analyze my images because this happens sometimes, sometimes not, and I can't really figure why or how it happens.

~suv
Posts: 2272
Joined: Sun May 10, 2009 2:07 am

Re: 0.91 bad/dirty alpha vs 0.48 good/fine alpha.

Postby ~suv » Thu Oct 15, 2015 12:36 am

toxigames wrote:(…) can I ask you to copy paste the command line you give ImageMagick to print the info you found?

Verbose information about image:

Code: Select all

identify -verbose your_image.png

More information about the 'identify' command:

Code: Select all

identify -help

Online reference: ImageMagick: Command-line Tools: Identify

toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

Re: 0.91 bad/dirty alpha vs 0.48 good/fine alpha.

Postby toxigames » Thu Oct 15, 2015 1:17 am

Thank you! I managed to print the info for a new image, made using 0.91. The image displays bad white edges when scaled down (but nothing when scaling up), but this time it also shows when scaling in any image viewer. This is the info:

Background color: white
Alpha: srgba(255,255,255,0) #FFFFFF00


This is the image:

https://www.dropbox.com/s/owblqsji8nd4n ... 5.zip?dl=0

Do you know why this particular image displays white edges when scaled?

toxigames
Posts: 149
Joined: Sat Aug 17, 2013 7:28 pm

Re: 0.91 bad/dirty alpha vs 0.48 good/fine alpha.

Postby toxigames » Fri Oct 16, 2015 12:47 am

I found out that changing the color of the transparent to brown worked very well in my game. The semi transparent dark green edge on my sprite drawn over light blue and over light brown does not show artifacts when color of transparency is brown. It's a bit annoying though that I have to run ImageMagick on each created png image just to change to brown. Isn't it possible to tell Inkscape to save the png with a browncolored transparency?


Return to “Help with using Inkscape”