GhostScript でテキストデータのアンチエイリアスを有効にする
2011-8-29 21:20
GhostScript で PDF など PostScript データを JPEG や PNG などの画像ファイルに変換できます。
このとき、テキストデータの文字がレンダリングされたときに、エッジがぎざぎざになってしまいます。

GhostScript で dTextAlphaBits=1
フォントにアンチエイリアスをかけてきれいに描画するには、-dTextAlphaBitsを GhostScript の引数に指定します。以下は Windows での例です。
C:gsgs9.04bin>gswin32c.exe -dBATCH -dNOPAUSE -sDEVICE=jpeg -r72 -g512x512 -dTextAlphaBits=4 -sOutputFile=output.jpg input.eps
-dTextAlphaBits は 1, 2, 4
の値をとります。未指定のときは 1 で、このときはアンチエイリアスがかかりません。2の時はアンチエイリアス処理が弱く、4の時は強くかかります。基本的には 4 を常に指定しておけば良さそうです。

GhostScript で dTextAlphaBits=2

GhostScript で dTextAlphaBits=4
その分処理に時間がかかるようですが、体感的に大きな差が無く、また dTextAlphaBits が大きいほど生成される JPEG ファイルのサイズも小さくなる傾向がありました。
コメントはまだありません
No comments yet.
Sorry, the comment form is closed at this time.