diff --git a/cmy/cmy.sh b/cmy/cmy.sh new file mode 100644 index 0000000..28ab1f5 --- /dev/null +++ b/cmy/cmy.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +FILEPATH=`realpath "${1}"` +DIR=`dirname "${FILEPATH}"` +FILENAME=`basename "${FILEPATH}"` +NAME=`echo "${FILENAME}" | cut -d'.' -f1` +EXTENSION="png" +CHANNELS=("c" "m" "y") + +convert "${FILEPATH}" \ + -negate \ + -set colorspace CMYK \ + -channel CMY \ + -separate \ + "${DIR}/${NAME}_%d.${EXTENSION}" + +for ((i=0;i<${#CHANNELS[@]};++i)); do + CHANNEL="${CHANNELS[i]}" + mv "${DIR}/${NAME}_${i}.${EXTENSION}" "${DIR}/${NAME}_${CHANNEL}.${EXTENSION}" +done \ No newline at end of file diff --git a/cmy/combine.sh b/cmy/combine.sh new file mode 100644 index 0000000..14e45b3 --- /dev/null +++ b/cmy/combine.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +FILEPATH=`realpath "${1}"` +DIR=`dirname "${FILEPATH}"` +FILENAME=`basename "${FILEPATH}"` +NAME=`echo "${FILENAME}" | cut -d'.' -f1` +EXTENSION="png" +CHANNELS=("c" "m" "y") +OUTPUT="${DIR}/${NAME}_cmy.${EXTENSION}" +CYAN="${DIR}/${NAME}_c.${EXTENSION}.rendered.${EXTENSION}" +MAGENTA="${DIR}/${NAME}_m.${EXTENSION}.rendered.${EXTENSION}" +YELLOW="${DIR}/${NAME}_y.${EXTENSION}.rendered.${EXTENSION}" + +WIDTH=404 +HEIGHT=374 + +convert -size "${WIDTH}x${HEIGHT}" xc:rgb\(0,255,255\) cyan.png +convert -size "${WIDTH}x${HEIGHT}" xc:rgb\(255,0,255\) magenta.png +convert -size "${WIDTH}x${HEIGHT}" xc:rgb\(255,255,0\) yellow.png + +composite -colorspace RGB -compose screen "${CYAN}" cyan.png cyan_comp.png +composite -colorspace RGB -compose screen "${MAGENTA}" magenta.png magenta_comp.png +composite -colorspace RGB -compose screen "${YELLOW}" yellow.png yellow_comp.png + +composite -colorspace RGB -compose multiply yellow_comp.png cyan_comp.png 1.png +composite -colorspace RGB -compose multiply 1.png magenta_comp.png "${OUTPUT}" + +rm cyan.png +rm magenta.png +rm yellow.png + +#rm cyan_comp.png +#rm magenta_comp.png +#rm yellow_comp.png + +#rm 1.png + +mogrify -negate "${OUTPUT}" + +open "${OUTPUT}" diff --git a/cmy/stipple.sh b/cmy/stipple.sh new file mode 100644 index 0000000..44e9c56 --- /dev/null +++ b/cmy/stipple.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +INPUT=`realpath "${1}"` +PNG="${INPUT}.rendered.png" +SVG="${INPUT}.rendered.svg" + +WIDTH=404 +HEIGHT=374 +DOTSIZE=4 +MAXGENERATIONS=25 +MAXPARTICLES=750 +MINDOTSIZE=0.8 +LINE=0.8 +FILL=true + +cd ~/src/stipple_gen/ + +bash stipple_gen.sh \ + --inputImage "${INPUT}" \ + --outputImage "${PNG}" \ + --outputSVG "${SVG}" \ + --canvasWidth $WIDTH \ + --canvasHeight $HEIGHT \ + --dotSizeFactor $DOTSIZE \ + --windowWidth $WIDTH \ + --windowHeight $HEIGHT \ + --maxGenerations $MAXGENERATIONS \ + --minDotSize $MINDOTSIZE \ + --line $LINE \ + --fill $FILL \ + --maxParticles $MAXPARTICLES