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