Skip to content

Instantly share code, notes, and snippets.

@zmalltalker
Created January 11, 2019 07:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zmalltalker/c7f7f6b5475407d915ff4991d940bb8f to your computer and use it in GitHub Desktop.
Save zmalltalker/c7f7f6b5475407d915ff4991d940bb8f to your computer and use it in GitHub Desktop.
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