mirror of
https://github.com/keyboardio/Chrysalis.git
synced 2026-02-28 19:07:17 +01:00
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>
26 lines
741 B
Bash
Executable File
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}"
|