Skip to content

Instantly share code, notes, and snippets.

@hoojaoh
Created June 11, 2017 19:49
Show Gist options
  • Save hoojaoh/bbfef5d9b3f56d1b321e99ccb2ce4fc0 to your computer and use it in GitHub Desktop.
Save hoojaoh/bbfef5d9b3f56d1b321e99ccb2ce4fc0 to your computer and use it in GitHub Desktop.
image.1hash.xyz

image.1hash.xyz

Pro Bash image processing in HTTP

API Explorer

Supoported Commands

Random photos from web

Resizing

/get?img=http://i.imgur.com/1uYroRF.gif
&cmd=["convert","-","-resize","100x"]

link

Delaying

/get?img=http://i.imgur.com/1uYroRF.gif
&cmd=["convert","-delay","10","-","gif:-"]

link

Format conversion

/get?img=http://i.imgur.com/1uYroRF.gif&cmd=["convert","-","png:-"]

link

Piping

/get?img=http://i.imgur.com/1uYroRF.gif
&cmd=["convert","-","-resize","100x100","png:-"]
&cmd=["convert","-","-crop","50x50","png:-"]

link

Compression with pngquant (633KB -> 176KB)

/get?img=http://img07.deviantart.net/289b/i/2011/354/5/7/cutout_landscape_by_oilusionista_stock-d4jow32.png
&cmd=["pngquant","128","-"]

link

Stack multiple input

/get?img=http://i.imgur.com/1uYroRF.gif&img=http://i.imgur.com/lVlPvCB.gif
&cmd=["convert","-","gif:-"]

link

Appendix

Would like to see this be a production service? Got a feature request? Comment in https://news.ycombinator.com/item?id=14529910 or drop me a line at http://keybase.io/mzh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment