Last active
October 14, 2024 14:24
-
-
Save quotepilgrim/ddbe992c75880104176a589023115467 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -e | |
| infile=$1 | |
| outfile="${infile%.*}.png" | |
| width=$(($2 - 2)) | |
| bytes=$((width * width * 3)) | |
| cat "$infile" /dev/zero | head -c $bytes | | |
| magick -depth 8 -size "$width"x"$width" rgb:- -separate +channel\ | |
| -swap 0,2 -combine -bordercolor Black -border 1x1 "$outfile" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| set -e | |
| infile=$1 | |
| outfile="${infile%.*}.txt" | |
| magick "$infile" -separate +channel -swap 0,2 -combine rgb:- | | |
| tr -d '\000' >"$outfile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment