summaryrefslogtreecommitdiff
path: root/conv.sh
diff options
context:
space:
mode:
authoruvok2025-07-19 13:22:11 +0200
committeruvok2025-07-19 13:22:11 +0200
commitfe6a86dcce35dd1ac1295d3feec8ae92b76e7b46 (patch)
treed09e43bc5b1bdca888d334ddd3788f80ded05b4e /conv.sh
parentcde2c46b4fcc027e7e64510a3241c196f6fe5ba0 (diff)
Update conversion script, try various methods
Diffstat (limited to 'conv.sh')
-rw-r--r--conv.sh43
1 files changed, 37 insertions, 6 deletions
diff --git a/conv.sh b/conv.sh
index fb9b053..8c6426b 100644
--- a/conv.sh
+++ b/conv.sh
@@ -1,8 +1,39 @@
-new_width=200
-new_height=200
-convert "$1" -resize ${new_width}x${new_height} -colorspace Gray -dither Floyd-Steinberg -monochrome output.jpg
-convert "$1" -resize ${new_width}x${new_height} -colorspace Gray -dither Floyd-Steinberg -monochrome output.xbm
-convert "$1" -resize ${new_width}x${new_height} -colorspace Gray -ordered-dither o8x8,4 -depth 1 output2.jpg
-convert "$1" -resize ${new_width}x${new_height} -colorspace Gray -ordered-dither o8x8,4 -depth 1 output2.xbm
+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"
+# "h3x3a"
+# "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