scripts

misc scripts and tools
git clone git://git.2f30.org/scripts.git
Log | Files | Refs

commit 90ade81e44002b2ececf3f183640526079d0561c
parent fc7e770a0bc0a9077b2479419d88ae764050930f
Author: lostd <lostd@2f30.org>
Date:   Tue,  3 Dec 2013 13:50:44 +0200

wireframe puffy generator

Diffstat:
puffy/Makefile | 16++++++++++++++++
puffy/puffy.sh | 26++++++++++++++++++++++++++
puffy/tshirt-23.gif | 0
3 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/puffy/Makefile b/puffy/Makefile @@ -0,0 +1,16 @@ +# wireframe puffy generator + +URL = http://www.openbsd.org/images/tshirt-23.gif +SRC = tshirt-23.gif +DST = puffy.png + +all: $(DST) + +$(DST): $(SRC) + sh puffy.sh + +$(SRC): + wget $(URL) + +clean: + rm $(DST) diff --git a/puffy/puffy.sh b/puffy/puffy.sh @@ -0,0 +1,26 @@ +#!/bin/sh + +# wireframe puffy generator +# img from: http://www.openbsd.org/images/tshirt-23.gif +# needs: imagemagick + +SRC=tshirt-23.gif +DST=puffy.png +COLOR=00FF00 +COLORNEG=$(echo "obase=16; ibase=16; FFFFFF - $COLOR" | bc) +GRAY=474747 # this is the bg val after grayscale +GEOM=646x600 + +# prepare masks +convert -size $GEOM xc:#$GRAY gray.png +convert -size $GEOM xc:#$COLORNEG colorneg.png + +# grayscale it +convert $SRC -colorspace gray -crop "$GEOM+1+1" puffy_gray.png +# apply gray mask until black background +composite puffy_gray.png gray.png -compose Minus puffy_black.png +# apply color mask to get foreground +composite puffy_black.png colorneg.png -compose Minus $DST + +# remove temp files +rm gray.png colorneg.png puffy_gray.png puffy_black.png diff --git a/puffy/tshirt-23.gif b/puffy/tshirt-23.gif Binary files differ.