Convert text to picture

echo -e "Some Text Line1\nSome Text Line 2" | convert -background none -density 196 -resample 72 -unsharp 0x.5 -font "Courier" text:- -trim +repage -bordercolor white -border 3 text.gif
generates a picture file with the text. Some other samples in: http://www.imagemagick.org/Usage/text/
Sample Output
the file text.gif is generated with the text.

18
2010-02-25 18:58:42

These Might Interest You

  • Image to text converter. Convert your scanned book in image format like .png, .jpg into editable text format. OCR ==> Optical Code Reader Show Sample Output


    -3
    gocr -i ~/Screenshot.png
    totti · 2013-02-28 07:38:13 1
  • I used this fragment with Imagemagick convert so that I can place long text strings in pictures. The "\n" gets converted to a true newline in the image. So this fragment uses fold command to wrap the line and then sed to convert newlines (and any trailing spaces on the line) to the text "\n" Show Sample Output


    1
    fold -sw 20 <(echo "Long Text to be wrapped with \"\n\"") |sed ':a;N;$!ba;s/ *\n/\\n/g'
    alecthegeek · 2015-04-16 21:06:53 3
  • This takes a webcam picture every everytime the mouse is moved (waits 10 seconds between checking for movement) and stores the picture wherever you want it. Ideas: Use in conjunction with a dropbox type application to see who is using your computer Use /dev/input/mice if /dev/input/mouse* doesn't work Use the bones of this to make a simple screensaver


    4
    while true; do sudo cat /dev/input/mouse0|read -n1;streamer -q -o /tmp/cam.jpeg -s 640x480 > /dev/null 2>&1; sleep 10;done
    SQUIIDUX · 2012-04-22 01:51:30 1
  • Encrypt any text to MD5 , replace text with the string you want to convert to MD5 Show Sample Output


    0
    wget -qO - --post-data "data[Row][clear]=text" http://md5-encryption.com | grep -A1 "Md5 encrypted state" | tail -n1 | cut -d '"' -f3 | sed 's/>//g; s/<\/b//g'
    samhagin · 2011-10-13 03:44:48 0

What Others Think

Sorry--meant to mark it +1, but hit down instead.
TeacherTiger · 433 weeks and 3 days ago
neato!
linuxrawkstar · 433 weeks and 3 days ago
how neato can be used to same ? if anyone knows how to generate a diff image with a cool code color for bash, C and java, pls let me know
glaudiston · 433 weeks and 3 days ago
doesn't seem to work for mac os x :(
kjowens · 431 weeks ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: