2025-02-17 16:22:13 +01:00
#!/bin/bash
2025-03-07 15:16:33 +01:00
TEXTTITLE = $( printf "(Un)Repair Cafe" )
2025-08-05 18:51:32 +02:00
TEXTSUBTITLE = "Every thursday"
2025-03-18 17:46:11 +01:00
TEXTLOCATION = $( printf "CATU" )
TEXTADDRESS = $( printf "Catullusweg 11\nRotterdam" )
2025-03-07 15:16:33 +01:00
TEXTLOCATIONLONG = $( printf "CATU\nCatullusweg 11\nRotterdam" )
DESCRIPTION = $( printf "Do you dig trough trash only to\n find treasure? Are you interested in \nbuilding servers? Do you take the shop\n out of photoshop? Is a printer jam your \n kind of jam? \n Come hang at the (un)repair cafe!" )
QRDESCRIPTION = $( printf "*Check out calendar.klank.school \n for more details!" )
2025-08-05 18:51:32 +02:00
QRDESCRIPTION = $( printf "*Check out calendar.klank.school \n for more details!" )
FREE = $( printf "FREE!" )
2025-02-17 16:22:13 +01:00
2025-08-05 18:51:32 +02:00
# Set date text (second parameter, with default)
if [ -n " $1 " ] ; then
TEXTDATE = $( printf " $1 \n18:00-22:00 " )
FILENAME_SUFFIX = $( printf "" ${ 1 ////- } "_out" )
else
TEXTDATE = $( printf "31/07\n18:00-22:00" )
FILENAME_SUFFIX = "output"
fi
2025-02-17 16:22:13 +01:00
2025-08-05 18:51:32 +02:00
echo " Using date: $TEXTDATE "
echo " Filename suffix: $FILENAME_SUFFIX "
echo "Make output_landscape"
2025-03-07 15:16:33 +01:00
# Create the image with text overlays landscape
2025-08-05 18:51:32 +02:00
magick assets/landscape_1.jpg \
2025-02-17 16:22:13 +01:00
-gamma 1 +level 0,1000 -white-threshold 999 \
2025-08-05 18:51:32 +02:00
\( +clone -colorspace gray -threshold 80% -fill green -colorize 40% \) \
-compose over -composite \
-gamma .5 +level 100,1000 \
-morphology Convolve \
"3x3: -2 -1 0 -1 1 1 0 1 0" \
-morphology Convolve \
"3x3: -2 -1 0 -1 1 1 0 1 0" \
-morphology Distance Euclidean:1,80 -auto-level \
2025-03-07 15:16:33 +01:00
-font Courier \
2025-08-05 18:51:32 +02:00
-gamma 0.05 \
2025-02-17 16:22:13 +01:00
-wave -20x4 \
-weight 900 \
-fill white \
\( -pointsize 200 -draw " rotate -19 gravity northwest text -150,1200 ' $TEXTTITLE ' " \) \
\( -pointsize 100 -draw " rotate -19 gravity northwest text -220, 1820 ' $TEXTSUBTITLE ' " \) \
\( -pointsize 100 -draw " gravity southeast text 400,950 ' $TEXTDATE ' " \) \
2025-03-18 17:46:11 +01:00
\( -pointsize 100 -draw " gravity southeast text 400,400 ' $TEXTLOCATIONLONG ' " \) \
2025-02-17 16:22:13 +01:00
-wave -2x0 \
2025-08-05 18:51:32 +02:00
-auto-level \
-morphology Convolve \
"3x3: -2 -1 0 -1 1 1 0 1 0" \
${ FILENAME_SUFFIX } _landscape.jpg
2025-02-17 16:22:13 +01:00
2025-08-05 18:51:32 +02:00
echo "Make output_poster"
2025-03-07 15:16:33 +01:00
# create a portrait poster
2025-08-05 18:51:32 +02:00
magick assets/poster_6.jpg \
2025-03-07 15:16:33 +01:00
-gamma 1 +level 0,2200 \
2025-02-17 16:22:13 +01:00
-morphology Distance Euclidean:4,180 -auto-level \
2025-03-07 15:16:33 +01:00
-font Courier \
-wave -20x4 \
2025-02-17 16:22:13 +01:00
-weight 900 \
2025-03-07 15:16:33 +01:00
-fill white \
2025-08-05 18:51:32 +02:00
-pointsize 120 -draw " rotate 7 gravity northwest text 250,200 ' $TEXTTITLE ' " \
2025-03-07 15:16:33 +01:00
-fill white \
2025-08-05 18:51:32 +02:00
-pointsize 70 -draw " rotate 6 gravity northwest text 250,380 ' $TEXTSUBTITLE ' " \
2025-03-07 15:16:33 +01:00
-fill white \
2025-08-05 18:51:32 +02:00
-pointsize 48 -interline-spacing 5 -draw " rotate 6 gravity northwest text 320,580 ' $TEXTLOCATIONLONG ' " \
-wave -2x0 \
-pointsize 40 -interline-spacing 20 -draw " rotate 1 gravity southwest text 300,360 ' $DESCRIPTION ' " \
${ FILENAME_SUFFIX } _poster.jpg
2025-03-07 15:16:33 +01:00
# Create an A6 poster
2025-08-05 18:51:32 +02:00
echo "Make output_A6_qr"
magick assets/poster_1.jpg \
2025-03-07 15:16:33 +01:00
-resize "1240x1748" \
-gamma 0.3 +level 10,1000 \
-morphology Distance Euclidean:4,80 -auto-level \
-font Courier -weight Bold \
-wave -10x4 \
-fill white \
2025-08-05 18:51:32 +02:00
-pointsize 80 -draw " rotate 7 gravity northwest text 150,150 ' $TEXTTITLE ' " \
2025-03-07 15:16:33 +01:00
-fill white \
2025-08-05 18:51:32 +02:00
-pointsize 50 -draw " rotate 7 gravity northwest text 160,250 ' $TEXTSUBTITLE ' " \
2025-03-07 15:16:33 +01:00
-fill white \
2025-08-05 18:51:32 +02:00
-pointsize 30 -interline-spacing 5 -draw " rotate 6 gravity northwest text 240,450 ' $TEXTLOCATIONLONG ' " \
-wave -2x0 \
-pointsize 30 -interline-spacing 10 -draw " rotate 1 gravity southwest text 200,300 ' $DESCRIPTION ' " \
${ FILENAME_SUFFIX } _A6.jpg
2025-03-07 15:16:33 +01:00
2025-08-05 18:51:32 +02:00
magick calendar.jpg -background none -rotate 10 -resize "50%" tmp_calendar.png
2025-03-07 15:16:33 +01:00
# Put a QR code on an A6 poster
2025-08-05 18:51:32 +02:00
magick ${ FILENAME_SUFFIX } _A6.jpg \
2025-03-07 15:16:33 +01:00
-fill tomato \
-draw "rotate 10 rectangle 840,690 1120,970" \
2025-08-05 18:51:32 +02:00
tmp_calendar.png \
2025-03-07 15:16:33 +01:00
-gravity center \
-geometry +200+100 \
-font Courier -weight Bold \
-pointsize 24 -interline-spacing 10 -draw " rotate 10 gravity center text 200,-120 ' $QRDESCRIPTION ' " \
2025-08-05 18:51:32 +02:00
-composite ${ FILENAME_SUFFIX } _A6_QR.jpg
2025-03-07 15:16:33 +01:00
2025-03-18 17:46:11 +01:00
rm tmp_calendar.png
# Create a rectangle image
2025-08-05 18:51:32 +02:00
echo "Make rectangle_1"
magick assets/rectangle_1.jpg \
2025-03-18 17:46:11 +01:00
-resize "1240x1240" \
2025-08-05 18:51:32 +02:00
\( +clone -colorspace gray -threshold 80% -fill green -colorize 40% \) \
-compose over -composite \
-gamma .5 +level 100,1000 \
-morphology Convolve \
"3x3: -2 -1 0 -1 1 1 0 1 0" \
-morphology Convolve \
"3x3: -2 -1 0 -1 1 1 0 1 0" \
-morphology Distance Euclidean:1,80 -auto-level \
-font Courier -weight Bold \
-wave -10x5 \
-fill white \
-pointsize 120 -draw " rotate -18 gravity center text 30,-200 ' $TEXTTITLE ' " \
-pointsize 50 -draw " rotate -18 gravity center text -100,0 ' $TEXTSUBTITLE ' " \
-pointsize 50 -interline-spacing 5 -draw " rotate -2 gravity southeast text 60, 150 ' $TEXTADDRESS ' " \
-pointsize 40 -interline-spacing 5 -draw " rotate -2 gravity southeast text 80,380 ' $TEXTDATE ' " \
-wave 1x40 \
-auto-level \
-morphology Convolve \
"3x3: -2 -1 0 -1 1 1 0 5 0" \
${ FILENAME_SUFFIX } _rectangle.jpg
# Create a another poster
echo "Make poster_2"
magick assets/poster_5.jpg \
-resize "1240x1748" \
\( +clone -colorspace gray -threshold 80% -fill green -colorize 40% \) \
-compose over -composite \
2025-03-18 17:46:11 +01:00
-gamma .5 +level 100,1000 \
-morphology Convolve \
"3x3: -2 -1 0 -1 1 1 0 1 0" \
-morphology Convolve \
"3x3: -2 -1 0 -1 1 1 0 1 0" \
-morphology Distance Euclidean:1,80 -auto-level \
-font Courier -weight Bold \
-gamma 0.05 \
-wave -10x5 \
-fill white \
2025-08-05 18:51:32 +02:00
-pointsize 120 -draw " rotate 7 gravity northwest text 90,90 ' $TEXTTITLE ' " \
2025-03-18 17:46:11 +01:00
-fill white \
2025-08-05 18:51:32 +02:00
-pointsize 60 -draw " rotate 6 gravity northwest text 120,250 ' $TEXTSUBTITLE ' " \
2025-03-18 17:46:11 +01:00
-fill white \
2025-08-05 18:51:32 +02:00
-pointsize 48 -interline-spacing 5 -draw " rotate 6 gravity northwest text 220,480 ' $TEXTLOCATIONLONG ' " \
-pointsize 38 -interline-spacing 20 -draw " rotate 1 gravity southwest text 150,260 ' $DESCRIPTION ' " \
2025-03-18 17:46:11 +01:00
-wave 1x40 \
2025-08-05 18:51:32 +02:00
-pointsize 35 -interline-spacing 5 -draw " rotate 2 gravity center text 200, 150 ' $QRDESCRIPTION " \
2025-03-18 17:46:11 +01:00
-auto-level \
-morphology Convolve \
"3x3: -2 -1 0 -1 1 1 0 1 0" \
2025-08-05 18:51:32 +02:00
${ FILENAME_SUFFIX } _poster2.jpg
# Create a rectangle image
echo "Make poster_3"
magick assets/poster_5.jpg \
-resize "1240x1748" \
-morphology Distance Euclidean:1,600 -auto-level \
-gamma 0.23 +level 10,1000 \
-morphology Convolve \
"3x3: -2 -6 0 -1 1 1 0 5 3" \
-morphology Distance Euclidean:4,80 -auto-level \
-font Courier -weight Bold \
-wave -10x5 \
-fill white \
-pointsize 120 -draw " rotate 7 gravity northwest text 150,90 ' $TEXTTITLE ' " \
-pointsize 65 -draw " rotate 6 gravity northwest text 150,250 ' $TEXTSUBTITLE ' " \
-pointsize 40 -interline-spacing 5 -draw " rotate 6 gravity northwest text 250,450 ' $TEXTLOCATIONLONG ' " \
-pointsize 55 -interline-spacing 5 -draw " rotate -4 gravity northwest text 160,700 ' $FREE ' " \
-pointsize 32 -interline-spacing 16 -draw " rotate 1 gravity southwest text 200,300 ' $DESCRIPTION ' " \
-pointsize 40 -interline-spacing 5 -draw " rotate 5 gravity center text 200,130 ' $TEXTDATE ' " \
-wave 1x80 \
-auto-level \
-morphology Convolve \
"3x3: -2 -91 0 -1 1 1 4 5 0" \
${ FILENAME_SUFFIX } _poster3.jpg