cascading-style
cascading-style

Reputation: 628

How to convert text to an image?

I'm trying to make a human verification system for my site, and I need a way to turn text
(e.g. What's twelve+3?) into an image (e.g. Example Image)...
Any idea how to do this on Windows Command Prompt? (I am using batch-files as CGI scripts)

P.S. A third-party tool is fine.

Upvotes: 0

Views: 1062

Answers (1)

jcalton88
jcalton88

Reputation: 160

From a Google search it looks like ImageMagick will do what you want. They have downloads for Windows, Mac and Linux. Download the windows portable or dll versions, depending on if you want to use the dll only.

Command from their tutorial to do what you want:

convert -background white -fill gray 
-pointsize 36 -size 320x 
caption:'This is a very long caption line.' caption.gif

You can change up the options to fit what you need. I would imagine you could substitute a variable with the text you need converted, you can use the @ symbol to pipe in a file as the source.

http://www.imagemagick.com

Upvotes: 1

Related Questions