Skip to content

Instantly share code, notes, and snippets.

@xslim
Created June 14, 2012 15:53
Show Gist options
  • Save xslim/2931120 to your computer and use it in GitHub Desktop.
Save xslim/2931120 to your computer and use it in GitHub Desktop.
Make 3px rounded corners on PNG images
#!/bin/bash
# Usage: find . -name "epg_cell_bg_*" -exec ./round_corners.sh '{}' \;
convert $1 \( +clone -alpha extract -draw 'fill black polygon 0,0 0,3 3,0 fill white circle 3,3, 3,0' \( +clone -flip \) \
-compose Multiply -composite \( +clone -flop \) -compose Multiply -composite \) -alpha off \
-compose CopyOpacity -composite $1
@gavrix
Copy link

gavrix commented Jun 14, 2012

script named "round_corners.sh" but in #usage you call "roundit.sh" — I guess there is a mistake there.

@xslim
Copy link
Author

xslim commented Jun 14, 2012

yep )
First it was called roundit )

@gavrix
Copy link

gavrix commented Jun 14, 2012

nice work, starred:)

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