Page 1 of 1

How to properly change color of postscript text?

Posted: 2012-09-17T03:46:49-07:00
by joew
Hello,

I have generated some postscript text with latex, that I want to overlay onto photos. But I have a hard time to change the color of this text. The closest I could get is:

Code: Select all

convert -channel RGBA -density 600 -gravity center \( my-text.ps -trim +repage \) -background none -fill gold -opaque black -filter lanczos -resize 300%x300% out.png
But this leaves some black pixels at the border of the text. I guess this is because of the subpixels.

Re: How to properly change color of postscript text?

Posted: 2012-09-17T23:17:19-07:00
by anthony
If the text is white on black (negate the text is it isn't) then use -background {color} -alpha shape
The image is now colored text on transparency. You can now overlay that on your image.
See IM Examples, Masking, Alpha Shape
http://www.imagemagick.org/Usage/masking/#alpha_shape

Note you can improve the look of the postscript to raster image conversion using -density to 'super-sample' the vector image.
See Text Handling, Postscript
http://www.imagemagick.org/Usage/text/#postscript