Browse Source

Split out image formatting

master
mid-kid 1 year ago
parent
commit
a0796888f6
  1. 4
      format_image.sh
  2. 2
      print_image.sh

4
format_image.sh

@ -0,0 +1,4 @@
#!/bin/sh
set -e
magick "$1"'[0]' -resize 512x1662\> -dither FloydSteinberg -remap pattern:gray50 pbm:-

2
print_image.sh

@ -2,7 +2,7 @@
set -e
dev=/dev/usb/lp0
image="$(magick "$1"'[0]' -resize 512x1662\> -dither FloydSteinberg -remap pattern:gray50 pbm:- | base64)"
image="$(./format_image "$1" | base64)"
data_header="$(echo "$image" | base64 -d | sed -n '2p')"
data="$(echo "$image" | base64 -d | tail -n +3 | base64)"

Loading…
Cancel
Save