ImageMagick and Python – Text to image


Today I was looked at imageMagick website . It was nice to see .

So from today I was going to learn some magic of ImageMagick 🙂

I am going to use Python to  do some task on some ImageMagick.

Today I done simple one , When we give our name and color . It will generate Image with

the name given.

Copy below and try your images


import os
import sys
print 'Enter the Following Below to create your Name as Image'
color = raw_input('Enter the color of font :')
background = raw_input('Enter the background color of image :')
size = raw_input('Enter the size of font :')
name = raw_input('Enter name of image i.e name which u want to display :')
name = name.replace(' ','')
file_name = raw_input('Enter name of file :')
image = 'convert -background '+background+' -fill '+color+' -pointsize '+size+' label'+':'+name+' '+file_name+'.gif'
os.system(image)

Output :

sathia@sathia27:~/Desktop$ python image.py
Enter the Following Below to create your Name as Image
Enter the color of font :green
Enter the background color of image :red
Enter the size of font :30
Enter name of image i.e name which u want to display :Happy Bithday
Enter name of file :sathia

This will generate

Have a colourful day 🙂 🙂

tada 🙂

Advertisements

About sathia

Web developer at cloudmint
This entry was posted in ImageMagick and Python. Bookmark the permalink.

One Response to ImageMagick and Python – Text to image

  1. V.Ramachandran says:

    Great.:-) This is awesome..
    Thanks for sharing..
    Keep rocking…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s