11

Building a project using Cairo for graphics processing. Neither of the anti-aliasing options produce a good enough result. I'm using an ARGB32 surface and writing to png.

I have tried using all of the hinting styles but I can see no change in the result.

The best option for text on both white and black will be option 4 but as you can see, it's still not as nice as an output produced from the imagemagick library in example 5.

Any input or suggestions welcome.

1. Using 'ANTIALIAS_DEFAULT'

example 1

2. Using 'ANTIALIAS_NONE'

example 2

3. Using 'ANTIALIAS_GRAY'

example 3

4. Using 'ANTIALIAS_SUBPIXEL'

axample 4

5. Using Imagemagick and it's default anti-aliasing

example 5

digout
  • 4,041
  • 1
  • 31
  • 38
  • 1
    Can I ask why Cairo, if the imagemagick library is the best tool why switch? Are you just gaining experience with Cairo? Curious... – manumoomoo May 16 '12 at 22:03
  • Cairo is much quicker in processing images, especially when there are multiple layers to process. It also aided my PDF requirements more suitably. – digout May 05 '14 at 11:43

1 Answers1

6

If you are stuck with Cairo, a workaround would be manual supersampling. Basically render it at a larger resolution (twice or 4 times the width and height), and then resize it to the correct size.

Sarke
  • 2,805
  • 2
  • 18
  • 28