Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save prsanjay/d2583d8e3cfca57afcd263f086b09742 to your computer and use it in GitHub Desktop.
Save prsanjay/d2583d8e3cfca57afcd263f086b09742 to your computer and use it in GitHub Desktop.
convert json signatures captured by thomasjbradley's signature-pad to an image
# see https://github.com/thomasjbradley/signature-pad for more details
instructions = JSON.load(data).map { |h| "line #{h['mx']},#{h['my']} #{h['lx']},#{h['ly']}" } * ' '
system "convert -size 198x55 xc:transparent -stroke blue -draw '#{instructions}' signature.png"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment