How can I prevent banding in my png?

Post questions on how to use or achieve an effect in Inkscape.
User avatar
pixabella
Posts: 53
Joined: Sat Oct 13, 2007 5:52 am
Contact:

How can I prevent banding in my png?

Postby pixabella » Thu Jun 05, 2008 3:18 am

Hi everyone,

A while back I had problems with one of my images banding when I previewed the png after export. Since then new versions of Inkscape have been released. I am currently running the latest build but my latest .svg file is experiencing the same banding issues once exported. Could someone please help me I am startting to get bald patches from ripping my hair out. Thanks

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: How can I prevent banding in my png?

Postby microUgly » Thu Jun 05, 2008 9:03 am

One immediate work around is to use Batik Rasterizer to convert the SVG to PNG.

Do you have an eaxample of the banding issue we can view? I thought I read on Launchpad that Inkscape is limited to 1024 colours in single gradient (I think the link is in that post you did about pixelation). I'm not sure if this has been increased in recent versions or not.

User avatar
pixabella
Posts: 53
Joined: Sat Oct 13, 2007 5:52 am
Contact:

Re: How can I prevent banding in my png?

Postby pixabella » Thu Jun 05, 2008 11:53 pm

Thanxs microugly for the info about the Batik rasterizer. I had another look in my .svg file and what I thought was banding was actually jagged pixelation. It's occurs when the edge of a light colour meets a dark colour. I have tried adjusting the colours, changing the thickness of lines but the pixelation is still present. I am using flesh tones against black and I have added another layer behind the image with a reduced opacity to try and bridge the colours. All my efforts have failed. :cry: How do you get crisp clear lines between dark and light colours when you colourize an image?

User avatar
microUgly
Site Admin
Posts: 2985
Joined: Sat Jun 02, 2007 3:13 pm
Contact:

Re: How can I prevent banding in my png?

Postby microUgly » Fri Jun 06, 2008 9:40 am

So you're refering to this issue again?

I've suggested here that stepping effect you are seeing is normal. Below is my effort to prove it :)

The original SVG (rendered by your browser)
SVG Image

PNG version saved by Inkscape 0.46
Image

PNG version saved by Adobe Illustrator CS3
Image

PNG version saved by GIMP
Image

an attempt at recreating the test image using just GIMP (I have no idea how to draw a line in GIMP)
Image

Unfortunately I don't have Batik Rasterizer handy at this instant to demonstrate how its PNG appears, but take my word for it, it's identical to the Inkscape version. I think it's fair to say that all programs produce the same stepping effect. This relates back to the fact that computer monitors are relatively low resolution.

But if you are really really not happy with this fact, export your image at 1.5 times the size your require, then resize the PNG down. The left image demonstrates the resulting effect compared to the original on the right.
ImageImage
For this method to work, you really have to go 1.5 time larger, or some other odd number. If you go exactly 2 times larger and scale it down you'll end up with almost the exact same stepping effect.

User avatar
pixabella
Posts: 53
Joined: Sat Oct 13, 2007 5:52 am
Contact:

Re: How can I prevent banding in my png?

Postby pixabella » Fri Jun 06, 2008 10:08 am

microugly thank you for taking the time to provide the screen shots so I could see the comparison. I will try exporting the file at 1.5 times and resize the png in Gimp.

Cheers I will let you know how I go. :)

User avatar
pixabella
Posts: 53
Joined: Sat Oct 13, 2007 5:52 am
Contact:

Re: How can I prevent banding in my png?

Postby pixabella » Sun Jun 08, 2008 8:56 am

@microugly
I followed your 1.5 conversion rate, exported the image as a png then resized it in Gimp. The resize reduced some of the banding issues, however I applied a blurred outline to smooth it out further. Unfortunately during this process the image has lost the crisp outline. I hope with further development of Inkscape the blur tool will become less of a crutch.

Thanks heaps microugly :)


Return to “Help with using Inkscape”