not enough anti-aliasing on export

Bug #947660 reported by Camilo Martin on 2012-03-06
40
This bug affects 9 people
Affects Status Importance Assigned to Milestone
Inkscape
Low
Mc

Bug Description

I normally use inkscape to create icons in small sizes, and anti-aliasing is a very important part of making them look good. Normally, the "export as bitmap" tool does a poor job, and I have to fix it up in a bitmap program (commonly GIMP or Photoshop).

I will show here an example with both the bug (as I see it) and how I fix it manually.

These are SVGs, they are three sizes of an icon of a small open-source program I'm making in my spare time:
http://msile.googlecode.com/svn/trunk/graphics/icons/msile/msile-16px.svg
http://msile.googlecode.com/svn/trunk/graphics/icons/msile/msile-32px.svg
http://msile.googlecode.com/svn/trunk/graphics/icons/msile/msile-48px.svg

They have 1px black strokes and 1px inner strokes of a light shade: this kind of thing creates even more aliasing, but helps achieve a crisp look if anti-aliasing is very good. It's recommended to use this trick in the Tango icon theme guidelines (http://tango.freedesktop.org/Tango_Icon_Theme_Guidelines) and I personally like how it looks (again, when properly anti-aliased).

Now, this is what happens if we just "export as bitmap":
http://i.imgur.com/SSYXM.png

As you can see, the anti-aliasing is very poor. So what this makes me do to fix it, manually? Simple: I just export in 1440 DPI, open in GIMP or Photoshop, and resize down to the correct size with either bicubic or Lanczos/Bicubic sharper. This is the result:
http://i.imgur.com/lIrfH.png

As you can see, it's much better.
In my very old machine (1 core @1.6GHz, 768 RAM) it takes an insignificant amount of time for a 48px icon, and I wouldn't mind it taking exponentially more for larger images. I took waaay more than a minute to make an icon, why not wait a bit for a better result? At least I'd like a checkbox somewhere that toggles a slower but higher quality algorithm that anti-aliases properly.

Also, it's not just because these are icons that I notice this kind of artifact; my girlfriend uses Inkscape to draw anime (http://hyanna-natsu.deviantart.com/), and she too sees a considerable difference in aliasing between just exporting as bitmap versus using the technique above, in drawings which are not icons and are much more free-hand.

Thank you for your time reading this, I hope you consider this suggestion. Inkscape is a very valuable program for me and others.

su_v (suv-lp) on 2012-03-06
tags: added: exporting renderer
removed: anti-aliasing antialiasing export raster rasterizing render rendering

Camilo:
What oversampling settings do you have in your preferences? (under
bitmap images section)
I'm using 8x8 and AA is acceptable.
Have you tried changing that value?

Gez

description: updated
Camilo Martin (herzschaltung) wrote :

@Gez:

Since that configuration is labeled as a bitmap resizing precision (not rendering of vectors into bitmaps), I didn't touch it. Now, I've set it to 16x16 and the results were precisely the same. After setting it to 16x16, the result is as in the "before" example I gave, using the files linked above.

Again, this kind of aliasing is normally more visible in small icons or other such things, since complex drawings have so many details as to mask these things from common perception.

Thank you for taking a look at this, however!

ToddB (sartre98) wrote :

Yeah, I have the same problem (V0.48.1, Win 7-64 bit). Changing from 4x4 to 16x16 does nothing.

Camilo Martin (herzschaltung) wrote :

I'm glad I'm not the only one who sees that :)

I noticed said problem with XP and several flavors of Linux.

nightrow (jb-benoit) on 2012-12-05
Changed in inkscape:
status: New → Confirmed
importance: Undecided → Low
bkgoodman (brad-bradgoodman) wrote :

FWIW - I am running into this - in the context of rendering SVG from command-line. I would like it if there were command-line (export) options to control (increase) antialiasing.

Eli Grey (sephr) wrote :

Good anti-aliasing is importance:low in a vector graphics app? Firefox and Chrome render SVGs for me with much much better anti-aliasing than Inkscape ever gives me.

Camilo Martin (herzschaltung) wrote :

@sephr - it is worthy of note that this bug is several years old and I bet it could be changed with a single line of code just telling the rendering library which supersampling to use.

(on a related rant, is Inkscape an abandoned project? It seems frozen in time...)

You seem to have deleted a comment/blog post mentioning how to render SVG in the browser as a fix, but (if Inkscape still has this bug) you can just render in higher DPI and then scale down with another app (or even an ImageMagick one-liner).

Mc (mc...) wrote :

I pushed in 15391 a patch that allows to choose between NONE, FAST, GOOD and BEST antialiasing modes, as defined in [1]. When I tested on my computer, there was no difference between GOOD (which should be the default already used) and BEST, but it might change in cairo with time, so I left both. There is not much more we can do inkscape-side, I'm afraid.

[1] https://www.cairographics.org/manual/cairo-cairo-t.html#cairo-antialias-t

Changed in inkscape:
milestone: none → 0.93
status: Confirmed → Fix Committed
assignee: nobody → Mc (mc...)
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Related blueprints