Skip to content

Instantly share code, notes, and snippets.

@miloops
Created October 4, 2010 14:56
Show Gist options
  • Save miloops/609824 to your computer and use it in GitHub Desktop.
Save miloops/609824 to your computer and use it in GitHub Desktop.
def convert_to_png(src, out)
system("gs -sDEVICE=ppmraw -r144x144 -sOutputFile=- -sNOPAUSE \
-q #{src} -c showpage -c quit | pnmcrop | pnmmargin -white 10 | pnmtopng > #{out} 2> /dev/null")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment