Skip to content

Instantly share code, notes, and snippets.

@nikku
Last active October 30, 2016 13:49
Show Gist options
  • Save nikku/dab8c111aff1cda48fa9ec2c7ef402f9 to your computer and use it in GitHub Desktop.
Save nikku/dab8c111aff1cda48fa9ec2c7ef402f9 to your computer and use it in GitHub Desktop.

macify

You like good application screenshots? Use a few lines of imagemagick to translate your ugly Windows, Linux or whatever application screenshots into Mac style (but plain and platform agnostic) ones.

#!/bin/bash

# usage:
#
#   macify source dest

# steps:
#
# (1) crop top
# (2) crop bottom
# (3) add header
# (4) draw circles
# (5) add border
# (6) overlay title (from `title.png`)

convert $1 \
    -crop +0+26 \
    -crop +0-2 \
    -background "#e0e4e8" -gravity North -splice 0x25 \
    -draw "fill #f25f65 circle 14,12 19,15" \
    -draw "fill #fbb857 circle 35,12 40,15" \
    -draw "fill #3eb55a circle 56,12 61,15" \
    -bordercolor "#d0d0d0" -border 2x2 \
    .macify.png

# draw title, image magick style (with no anti-aliasing...)
#   -draw "fill #787d7d font '/usr/share/fonts/TTF/DroidSans.ttf' kerning 0.3 font-size 14 translate 50%,32 text -52,0 'Camunda Modeler'" \

# compose with pre-rendered title image instead
composite -gravity North -geometry +0+9 title.png .macify.png $2

# get rid of temp file again
rm .macify.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment