简体   繁体   English

如何在开罗获得更好的抗锯齿结果(示例)

[英]How to get better anti-aliasing results in Cairo (examples shown)

Building a project using Cairo for graphics processing. 使用Cairo构建项目进行图形处理。 Neither of the anti-aliasing options produce a good enough result. 两种抗锯齿选项都没有产生足够好的结果。 I'm using an ARGB32 surface and writing to png. 我正在使用ARGB32表面并写入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. 白色和黑色文本的最佳选项将是选项4,但正如您所看到的,它仍然不如示例5中的imagemagick库生成的输出那么好。

Any input or suggestions welcome. 任何意见或建议欢迎。

1. Using 'ANTIALIAS_DEFAULT' 1.使用'ANTIALIAS_DEFAULT'

例1

2. Using 'ANTIALIAS_NONE' 2.使用'ANTIALIAS_NONE'

例2

3. Using 'ANTIALIAS_GRAY' 3.使用'ANTIALIAS_GRAY'

例3

4. Using 'ANTIALIAS_SUBPIXEL' 4.使用'ANTIALIAS_SUBPIXEL'

例4

5. Using Imagemagick and it's default anti-aliasing 5.使用Imagemagick,它是默认的抗锯齿

例5

If you are stuck with Cairo, a workaround would be manual supersampling. 如果你被Cairo困住,解决方法就是手动超级采样。 Basically render it at a larger resolution (twice or 4 times the width and height), and then resize it to the correct size. 基本上以更大的分辨率(宽度和高度的两倍或四倍)渲染它,然后将其调整到正确的大小。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM