Files
chrysalis-mirror/tools/update-screenshot.sh
Gergely Nagy e9c79f0722 tools: Update the screenshot tool
Recent ImageMagick prevents us from piping from import to convert directly, so
use an intermediate file as a workaround.

Furthermore, the white border was removed, because it didn't play nice with our
new Keyboardio-orange header.

Signed-off-by: Gergely Nagy <algernon@keyboard.io>
2022-05-30 09:25:20 +02:00

26 lines
741 B
Bash
Executable File

#! /bin/sh
TMP_RAW=$(mktemp --suffix .png)
TMP=$(mktemp --suffix .png)
echo "Taking screenshot..."
import -silent -window Chrysalis -format png "${TMP_RAW}"
convert "${TMP_RAW}" \
-alpha set -virtual-pixel transparent -channel A \
-blur 32x18 -threshold 50% +channel \
\
-background black \( +clone -shadow 60x4+0+0 \) +swap \
-background none -layers merge +repage \
\
"${TMP}"
rm -f "${TMP_RAW}"
echo "Crushing the image..."
pngcrush -brute -q "${TMP}" data/screenshot.png
rm -f "${TMP}"