Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python upscale image without blur PIL

enter image description here

I want to upscale an image using PIL. I have tried all of the antialiasing options, but none of them are right (I actually want no antialiasing at all). I don't want any blur, but a similar effect to texture packs in Minecraft.

This question has been asked before, but in Java: How to upscale an image without it becoming blurry

The solution was Bitmap#createScaledBitmap()

Can somebody give me an equivalent function for Python (please standard library)?

Any help is appreciated.

like image 200
Julius Naeumann Avatar asked Dec 05 '25 13:12

Julius Naeumann


1 Answers

The selected answer does not work with the 2020 API. PIL.Image.BOX is the right filter for upscale without blur, i.e.

from PIL import Image
c = Image.open(example)
d = c.resize((1000,700), resample=Image.BOX)
like image 165
Julien S. Avatar answered Dec 07 '25 12:12

Julien S.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!