Skip to content

Instantly share code, notes, and snippets.

Last active June 16, 2019 03:59
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Creating Thumbnails with GraphicsMagick
license: gpl-3.0

Finds PNG images in the source folder, and saves corresponding thumbnails to the target folder.

pushd source
for i in "${sources[@]}"; do
echo "Converting $i"
gm convert \
-crop 1920x1000+312+510 \
-resize 230x120 \
"$i" \
Copy link

johan commented Jan 28, 2013

How do you typically produce the source images for a gist? Viewing /d/gist_id full screen and saving a screenshot with Cmd+Shift+4? Some hack involving, some phantomjs hack, or something else?

Copy link

@johan good question! Would love to know how to streamline thumbnail creation and use in conjunction with gistup. This would be a great tip to add to the Let's Make a Block tutorial.

Note, some additional tips for semi-manually rightsizing your PNGs can be found on this d3.unconf HOWTO.

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