

rmdir /S /Q sprites 
rmdir /S /Q backsprites 
rmdir /S /Q backsprites_ 

mkdir sprites

wget -O sprites.png "https://web.archive.org/web/20221117081600/http://wyndows.sweb.cz/Pokemon Sprites in Gen 1 Style fixed.png"
wget -O backsprites.png "https://web.archive.org/web/20221117081602/http://www.wyndows.sweb.cz/Gen%%201%%20Backsprites.png"



.\imagemagick\magick sprites.png -crop 96x96 +repage -scene 1 +adjoin sprites/%%03d.png
.\imagemagick\mogrify -trim -flop -background white -gravity center -extent 56x56 -dither None -colors 4 sprites\*

REM convert xymons.png -crop 59x59 +repage +adjoin -crop 56x56+1+1 -scene 650 -colors 4 sprites/%03d.png

REM mkdir backsprites
xcopy /S /Y .\sprites\ .\backsprites\

.\imagemagick\mogrify -trim -flop +repage -background white -gravity northeast -crop 32x32-4+0! -flatten backsprites\*
.\imagemagick\mogrify -dither None -colors 4 backsprites\*

mkdir backsprites_
.\imagemagick\magick backsprites.png -crop 96x96 +repage -scene 1 +adjoin backsprites_\%%03d.png
.\imagemagick\mogrify -trim backsprites_\*

REM do lots of identifies and delete non-backsprites


forfiles /P .\backsprites_ /C "cmd /c %cd%\imagecheck.bat @file @path"











.\imagemagick\mogrify -trim +repage -background white -gravity south -crop 28x28+0+0! -gravity northwest -crop 32x32-0-0! -flatten backsprites_\*
.\imagemagick\mogrify -dither None -colors 4 backsprites_\*

robocopy /XC /XN /XO /S .\backsprites\ .\backsprites_\
PAUSE

cd ".\sprites"

for %%f in (*.png) do (
    python ..\gfx.py 2bpp "%%f"
)

cd "..\backsprites"

for %%f in (*.png) do (
    python ..\gfx.py 2bpp "%%f"
)

cd "..\backsprites_"

for %%f in (*.png) do (
    python ..\gfx.py 2bpp "%%f"
)

cd ..

pause

cd ".\sprites"

for %%f in (*.2bpp) do (
    python ..\pic.py compress "%%f"
)

cd "..\backsprites"

for %%f in (*.2bpp) do (
    python ..\pic.py compress "%%f"
)

cd "..\backsprites_"

for %%f in (*.2bpp) do (
    python ..\pic.py compress "%%f"
)

cd ..

pause

python rbypals.py

PAUSE