I need to render an SVG image with very small text, so I would like to use subpixel hinting, like so:

enter image description here

Inkscape doesn't provide an option to use subpixel hinting for PNG export, neither does the GIMP. However, I get excellent results when I view the image in EOG, the Gnome Image Viewer.

How do I use whatever Image Viewer uses to render my SVGs to PNG files with transparency?

Since subpixel hinting depends on the order of red, green and blue subpixels, EOG disables it when I use the Save As button. I can take a screenshot, but then I don't have transparency in my images. Is there any piece of software that can render text to raster images with anti-aliasing and subpixel hinting?

  • Probably in EOG, rendering is done by system (you have set it for LCD) so that's expected (your SVG is text, not bitmap). What is the font size you want to render?
    – zetah
    Jan 6 '12 at 22:20
  • Any font size really, but it's particularly bad at less than 18pt, unbearable below 9pt. Jan 21 '12 at 20:26

http://libregraphicsworld.org/blog/entry/getting-crisper-text-out-of-inkscape should help you :)

This blog post advises to select File → Save a Copy → Cairo PNG for cairo-based rendering.

  • When the link goes down: This blog post advises to select "File → Save a Copy → Cairo PNG" for cairo-based rendering. It certainly looks different, and a little bit better (no subpixel rendering). Thanks! Jan 21 '12 at 20:12

Anyway, I wanted to suggest SubLCD as I've used it in the past, but as it works with PPM images I just don't remember how I did transparency, and it's unusable for small fonts as is

Here is quick and dirty solution (I don't know about your source files and if this is usable to you, but in general works fine):

Render SVG on screen with EOG or else. Capture screenshot then paste it in Gimp and apply Colors > Color to Alpha on white (screenshot background) - result transparent PNG with subpixel rendered text

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.