I am trying to downsize images with no form of resampling. I want it to fully maintain hard edges, and not add any blur / antialiasing whatsoever. Essentially, exactly like the photoshop "Hard edges" resampling mode. However, each and every one of Pillow's built in resampling methods gives me some kind of blur or aliasing effects.
The code im using currently is as follows
fileName = "big.jpg"
for i in range(6):
filename16 = "small" + str(i) + ".jpg"
img = Image.open(fileName)
img16 = img.resize((16, 16), resample=i)
img16.save(filename16)
The results
Resized image to 16x16 by using;
Photoshop's "Nearest neighbour - Hard edges"
0 Pillow Nearest Neighbor
1 Pillow Lanczos
2 Pillow Linear
3 Pillow Bicubic
4 Pillow Box
5 Pillow Hamming
Or side by side, it can be clearly seen that all resampling methods change something about the image
How would i be able to get a result as that achieved by photoshop's "hard edges" option in Pillow? Thanks!










