Skip to content
This repository has been archived by the owner on Jan 19, 2023. It is now read-only.

Commit

Permalink
Add cr71.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarogh committed Mar 25, 2021
1 parent 527f5c5 commit 9d0f2af
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/liste_*.c

/images/*.pbm.contours
/cr71/

.idea

Expand Down
38 changes: 38 additions & 0 deletions cr71.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

# Génère les 15 images pour le CR de la tâche 7-1, en PNG, dimensions 400x400.
# Il faut: `gs`, ImageMagick (pour le redimensionnement), `sponge` (paquet "moreutils" sur apt), clang + GNU make

make contour_of

files="Asterix3.pbm lettre-L-cursive.pbm Picasso-ColombesDeLaPaix.pbm"
wd="cr71"

mkdir -p $wd
pushd $wd > /dev/null || exit

for image in $files
do
ln -s "../images/$image" .
done

for d in 0 1 3 10 30
do
for image in $files
do
img="$image-$d.png"
if [ $d = 0 ]
then
dd=""
else
dd="-b $d"
fi
>&2 ../contour_of $image $dd -3 -c
gs -dSAFER -dBATCH -dNOPAUSE -dEPSCrop -r600 -sDEVICE=png16m -sOutputFile=$img $image"-mode3.eps" > /dev/null
convert $img -resize 400x400 -colorspace RGB png:- | sponge $img
done
done

rm ./*.contours

popd > /dev/null || exit

0 comments on commit 9d0f2af

Please sign in to comment.