Created
September 8, 2018 13:56
-
-
Save monkeywithacupcake/9e0092733302668b2a4adbbfb1d35748 to your computer and use it in GitHub Desktop.
A shell script to generate an Image with text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Asks a series of questions and then returns an image | |
# use like "bash catchphrase.sh" | |
echo "What is your favorite color?" | |
read theColor | |
echo "What is your catchphrase?" | |
read thePhrase | |
convert -size 1000x1000 xc:$theColor +repage \ | |
-size 800x800 -fill white -background None \ | |
-font CourierNewB -gravity center caption:"$thePhrase" +repage \ | |
-gravity Center -composite -strip catchphraseimage.jpg | |
echo "See your special image at ${PWD}/catchphraseimage.jpg" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @TarunavBA You can see that I got an error from ImageMagick on fonts, but it still made the image.
I used terminal to create a new file called catchphrase.sh and then I pasted my code above directly. Then, I saved that and then ran
bash catchphrase.sh
and it was interactive.