If I create a gradient between two similar colours in Inkscape and export it to a png it looks something like this:

If you look closely you can see rings.
If I create a gradient in GIMP, there's the option to use dithering to prevent such rings or lines.
How do I convert my svg to a png using dithering for gradients?
|
|
|||||||||
|
|
Try Gimp "Spread" filter (Filter > Noise > Spread) with 40px value for your sample I found it in a comment in Inkscape bug tracker and it produces great results IMHO |
|||||||||||
|
Yeah, no. Dithering in gradients is not done for reasons of resolution, but for reasons of bit-rate. You get banding effects because InkScape's export to PNG incorrectly rounds down the (floating-point) RGB values of the interpolated gradient to 8-bit values (256 steps). This results in a very annoying and noticeable type of banding noise (as opposed to aliasing noise which would be the case if we were talking about resolution). Applying dither is a form of noise-shaping, which doesn't reduce the noise but spreads it out in spatial domain so it doesn't correlate into noticeable shapes any more (I'll spare you the signal theory). Your "solution" of applying the spread noise filter in GIMP really is no better than someone encountering jagged edges in line-art, asking directly about the anti-aliasing option, and telling them to apply a Gaussian blur! Consider: A photo, reduced to 4 colours with no dither, and a spread noise filter applied afterwards. A photo reduced to 4 colours with dither. Which one looks better? How do you "hide" jagged edges -> blur. How do you solve jagged edges -> anti aliasing when rendering. How do you "hide" banding in gradients -> spread noise, etc (there's better tricks but you always end up throwing away fidelity). How do you SOLVE banding in gradients -> apply dithering during render! So yeah, I can actually understand the attitude, when asking how to solve a problem, being told to sort of brush it under the carpet. That's not a solution for a serious graphics designer. I'm currently wrestling with the same problem. The question also was perfectly clear, I know because I arrived at this page looking for the same answer. What I'm trying to do is applying a slight layer of noise with a filter or extension in InkScape, which is hopefully applied before rendering, bumping the rounding error around a bit, resulting in a not-optimal but better-than-nothing poor man's noise-shaper. But at least it'll preserve the detail that doesn't require dither :) |
|||
|
|
|
Please don't consider this as answer. I'm writing it as answer as writing comment is limiting This seems to be known problem with Inkscape. Quick googling showed to me:
I'll just add that last step is my suggestion and while you could try Xara or sK1 it seems to me that only commercial tools (CorelDraw, Illustrator...) offer flawless features, which has to be indeed considered when doing serious work, as you won't like things like this happen after rendering Cheers |
|||
|
|
