summaryrefslogtreecommitdiff
path: root/conv.sh
blob: a6bfdd5055eb589bd4fcd34277025514f6876eb1 (plain)
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


new_width=296
new_height=128
COMMON_OPT="-resize ${new_width}x${new_height} -colorspace Gray"
DEPTH="-depth 1"
#DEPTH=""


modes=(
  "o8x8"
  "h4x4a"


  "checks"
  "o3x3"
  "o4x4"
  "threshold"
  "h4x4o"
  "h6x6o"
  "h8x8o"
  "h16x16o"
  "h6x6a"
  "h8x8a"
)
for mode in "${modes[@]}"; do
    convert "$1" ${COMMON_OPT} -ordered-dither ${mode} ${DEPTH} output-${mode}.jpg
    convert "$1" ${COMMON_OPT} -ordered-dither ${mode} ${DEPTH} src/output_${mode}.xbm
done

exit 0

convert "$1" ${COMMON_OPT} -ordered-dither o8x8 ${DEPTH} outputr.jpg
convert "$1" ${COMMON_OPT} -ordered-dither o8x8 ${DEPTH} outputr.xbm
convert "$1" ${COMMON_OPT} -ordered-dither o8x8,2 ${DEPTH} output2.jpg
convert "$1" ${COMMON_OPT} -ordered-dither o8x8,2 ${DEPTH} output2.xbm
convert "$1" ${COMMON_OPT} -ordered-dither o8x8,4 ${DEPTH} output4.jpg
convert "$1" ${COMMON_OPT} -ordered-dither o8x8,4 ${DEPTH} output4.xbm