songflower

reflow bitmap sheet music to a different paper format
git clone https://a3nm.net/git/songflower/
Log | Files | Refs | README | LICENSE

fix_melodia.sh (2183B)


      1 #!/bin/bash
      2 
      3 WIDTH="$1"
      4 
      5 for a in $(seq 0 9)
      6 do
      7   rm -f chunks/page_000${a}*.png
      8 done
      9 
     10 rm -f chunks/page_0010_0000*.png
     11 
     12 # volume headings
     13 # rm -f chunks/page_0010_0001*.png
     14 # rm -f chunks/page_0050_0000*.png
     15 # rm -f chunks/page_0110_0000*.png
     16 #   
     17 # 
     18 # rm -f chunks/page_0050_0001*.png
     19 # rm -f chunks/page_0070_0000*.png
     20 # rm -f chunks/page_0082_0002*.png
     21 # rm -f chunks/page_0085_0000*.png
     22 # rm -f chunks/page_0085_0009*.png
     23 # rm -f chunks/page_0090_0000*.png
     24 # rm -f chunks/page_0138_0000*.png
     25 # rm -f chunks/page_0140_0000*.png
     26 # rm -f chunks/page_0160_0000*.png
     27 # rm -f chunks/page_0160_0001*.png
     28 # rm -f chunks/page_0170_0000*.png
     29 # rm -f chunks/page_0170_0001*.png
     30 # rm -f chunks/page_0174_0010*.png
     31 # rm -f chunks/page_0177_0012*.png
     32 # rm -f chunks/page_0180_0011*.png
     33 # rm -f chunks/page_0186_0000*.png
     34 # rm -f chunks/page_0215_*.png
     35 
     36 convert -density 1200 -resize ${WIDTH}x melodia_title_page.svg chunks/page_0000_0000.png
     37 
     38 rm -f chunks/page_0012_0003*            
     39 ./splitw.py --weightthreshold=6 lines/page_0012_0003.png chunks "$WIDTH"
     40 
     41 rm -f chunks/page_0013_0000*
     42 ./splitw.py --weightthreshold=20 --weightwindow=3 lines/page_0013_0000.png chunks "$WIDTH"
     43 
     44 rm -f chunks/page_0019_0001*
     45 ./splitw.py --weightthreshold=10 --weightwindow=3 lines/page_0019_0001.png chunks "$WIDTH"
     46 
     47 rm -f lines/page_0058*.png; rm -f chunks/page_0058*.png;
     48 ./splith.py --distthreshold=500 --whitethreshold=2 pages/page_0058.png lines/;   
     49 for a in lines/page_0058*.png; do
     50   ./splitw.py --weightthreshold=10 --weightwindow=3 $a chunks "$WIDTH";
     51 done
     52 
     53 rm -f chunks/page_0153_0009*
     54 ./splitw.py --heightthreshold=8 lines/page_0153_0009.png chunks "$WIDTH"
     55 
     56 rm -f chunks/page_0159_0005*
     57 ./splitw.py --weightthreshold=12 lines/page_0159_0005.png chunks "$WIDTH"
     58 
     59 rm -f chunks/page_0159_0009*
     60 ./splitw.py --maxbardistance=20 lines/page_0159_0009.png chunks "$WIDTH"
     61 
     62 rm -f chunks/page_0167_0003*
     63 ./splitw.py --weightthreshold=20 lines/page_0167_0003.png chunks "$WIDTH"
     64 
     65 rm -f chunks/page_0169_0004*
     66 ./splitw.py --weightthreshold=20 --heightthreshold=20 lines/page_0169_0004.png chunks "$WIDTH"
     67 
     68 rm -f chunks/page_0171_0008*
     69 ./splitw.py --maxbardistance=20 lines/page_0171_0008.png chunks "$WIDTH"