Param (
    [string]$InFile,
    [string]$OutFile,
    [string]$Colors=16,
    [string]$Size="256x256",
    [string]$Pixel="7"
    )

cp $InFile temp.png
# magick temp.png -colors $Colors -quantize sRGB -dither FloydSteinberg color.png

magick temp.png -posterize $Colors -quantize sRGB -dither FloydSteinberg color.png

bash ./scripts/magick/pixelize -s $Pixel -m 2 color.png pixels.png

magick.exe pixels.png -interpolate nearest -interpolative-resize $Size $OutFile
