: 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
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?
Example:
I start with
I get this
But want this
Related links:
ImageMagick v6 Examples - Simple Interpolation Methods
ImageMagick: Command-line Options - interpolate
More posts by @Nimeshi706
1 Comments
Sorted by latest first Latest Oldest Best
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.