How it works
Every pixel is replaced by the palette colour closest to it, judged the way eyes see colour difference rather than by raw numbers, so skin tones and greens land where you expect.
The image keeps its size. Transparent areas stay transparent, and half-transparent edges become fully solid or fully clear, as pixel art expects.