This week I wanted to turn a 512x512 pixel image down to a 128x128 sized image. A noteworthy point is that this image was a pixel-art, and thus we needed to keep the edges sharp. Below is the image in question:

Full sized badge image
Full sized badge image

I brought out the trusty old imagemagick and resized it:

magick convert badge-full.webp -resize 128x128 badge-resize.webp

That got me this image:

Resized badge image
Resized badge image

If you were to open this new image and zoom in a bit, you will see that the edges of the pixels are not as sharply defined and there is a bit of color blending going on. We obviously don't want that.

Scaling to the rescue. We can scale the image like this:

magick convert badge-full.webp -scale 128x128 badge-scale.webp

That gives you the one you want, with clean and crisp borders:

Scaled badge image
Scaled badge image

The relevant documentation page for resize and scale.