Nearest neighbour interpolation not working in ImageMagick

I want to display an image and have the pixels big and clearly visible. As it’s common to display scaled image with some form of smooth filtering, the best option is to scale up the image resolution without interpolation (i.e. nearest). I have quite a few and need automation, hence ImageMagick.

I’m certain I’ve done this before and hit the same problem, but this time Google isn’t helping. I vaguely remember the order of the arguments can be quite important here but I’ve tried every permutation and the output is the same.

The following simply doesn’t work. It resizes the image correctly but it’s all blurry:

convert from.png -interpolate Nearest -resize 800% to.png

What am I missing?


I start with enter image description here

I get this enter image description here

But want this enter image description here

Related links:


Silly me. I found a solution in my bash history. I needed to set -filter point.

convert from.png -interpolate Nearest -filter point -resize 800% to.png

The default filter appears to be Cubic for me. Interestingly, -interpolate Nearest doesn’t seem to affect the output at all and may not be needed above. I’d love to know why and won’t accept this as the answer.

Source : Link , Question Author : jozxyqk , Answer Author : jozxyqk

Leave a Comment