summaryrefslogtreecommitdiffstats
path: root/.local/bin/sovl-dither
blob: 290420d32de7c62946e4505d0348da4d5bc2422f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

#Description: intakes a file and an output location, upscales it, and then adds dithering to it.

#Axioms: 

#Dependencies: https://packages.debian.org/sid/imagemagick https://github.com/xinntao/Real-ESRGAN-ncnn-vulkan

realesrgan -i "$1" -o "upscaled_$1"
convert -trim "upscaled_$1" -quantize transparent +dither -colors 64 -ordered-dither o2x2 -channel A -contrast-stretch 10% "$2dither_o2x2_upscaled_$1.jpg" 
convert -trim "upscaled_$1" -quantize transparent +dither -colors 64 -ordered-dither o2x2 -channel A -contrast-stretch 10% "$2dither_o3x3_upscaled_$1.jpg" 
convert -trim "upscaled_$1" -quantize transparent +dither -colors 64 -ordered-dither o2x2 -channel A -contrast-stretch 10% "$2dither_o4x4_upscaled_$1.jpg" 
convert -trim "$1" -quantize transparent +dither -colors 64 -ordered-dither o2x2 -channel A -contrast-stretch 10% "$2dither_o2x2_$1.jpg"
convert -trim "$1" -quantize transparent +dither -colors 64 -ordered-dither o3x3 -channel A -contrast-stretch 10% "$2dither_o3x3_$1.jpg"
convert -trim "$1" -quantize transparent +dither -colors 64 -ordered-dither o4x4 -channel A -contrast-stretch 10% "$2dither_o4x4_$1.jpg"