GMIC from a bash script

I sometimes dislike the standard settings of GMIC filters so I roll my own my checking the output of Gimp/GMIC in a terminal. Currently, this is my “sketchdark” script and below it some results.

#!/bin/bash
let "nbfiles = $#"
ref=$(kdialog --title "Sketch" --progressbar "(Initialising ...)" 15)
qdbus $ref Set org.kde.kdialog.ProgressDialog maximum $nbfiles
compteur=0
for i in "$@";do
	if [ -f "$i" ];then
            let "compteur +=1"
            FILE="$i"
	fi
    FILE_NO_EXT=${i%.*}
    echo $i
    echo $local
    gmic -i $i -fx_sketchbw 3,45,180,80,1.75,0.02,0.5,1.42,0.1,0.7,3,6,0,1,4,0,50,50 -o $FILE_NO_EXT-sketch80.jpg
    qdbus $ref setLabelText "Sketch: image created: `basename "$FILE"` ($compteur of $nbfiles files)"
    qdbus $ref Set org.kde.kdialog.ProgressDialog value $compteur

done
qdbus $ref close





5 Likes

Very nice, Mike! Thanks for sharing.

I like these. The outline is just there, at the edge of perception, but doesn’t bang one over the head as a more cartoon-like edge might.