Created
January 11, 2019 07:33
-
-
Save zmalltalker/c7f7f6b5475407d915ff4991d940bb8f to your computer and use it in GitHub Desktop.
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
def place_text(text) | |
x = 130 | |
y = 70 | |
message = text.tr("abcdefghijklmnopqrstuvwxyz","nopqrstuvwxyzabcdefghijklm") | |
parts = message.scan(/.{16}/) #rot13 | |
text_params = parts.map.with_index { |m, i| | |
y_pos = y + (i*10) | |
[i, x, y_pos] | |
"-fill orange -draw \"text #{x},#{y_pos} '#{m}'\"" | |
} | |
output_file_base = text.tr("^A-Za-z0-9",'_') | |
output_file = "#{output_file_base}.png" | |
command = "convert donald.png #{text_params.join(' ')} #{output_file}" | |
`#{command}` | |
`open #{output_file}` | |
end | |
place_text "I am so awesome. Love me, I promise you won't regret it" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment