/
go.sh
executable file
·43 lines (35 loc) · 888 Bytes
/
go.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
methods="
img2xterm
termplay
TerminalImageViewer
pixterm
timg
"
function img2xterm() {
/usr/local/bin/img2xterm $1 >$2
}
function termplay() {
/root/.cargo/bin/termplay image -h 160 -w 160 --ratio 178 $1 >$2
}
function TerminalImageViewer() {
script --return -c "/usr/local/bin/tiv -w 160 -h 160 -f $1.upscale" /dev/null | grep -v 'null' >$2
}
function pixterm() {
script --return -c "/root/gocode/bin/pixterm -tr 80 -tc 160 -s 1 $1" /dev/null | grep -v 'null' > $2
}
function timg() {
/usr/local/bin/timg -g 160x160 $1 >$2
}
function make_ascii () {
for input in /inputs/*.png; do
for method in $methods; do
filename=$(basename "$input")
short_filename="${filename%.*}"
output_filename="/ascii/${short_filename}.${method}.ascii"
echo $input using $method
time $method $input $output_filename
done
done
}
make_ascii