Skip to content
Advertisement

Python Pillow resized image (manga) page details are bad compared to the Photoshop

I have a manga page that has a resolution of 1360×1920. I want it to reduce to 496×700.

This is a part of the image without resolution reduced.

details

This is after lowering the resolution to 496×700.

reduced

This is the Photoshop version after the lowering resolution

enter image description here

In short, what photoshop does under the hood to get the result I have shown here? When resizing with photoshop you can select resample method to use. Which is NEAREST by default. I used the same method with Pillow library but still, the result didn’t change.

Sample Code

from PIL import Image, ImageFilter

img = Image.open("788.png")
img = img.resize((496, 700), Image.NEAREST)
img.save("low.png")

Advertisement

Answer

I found the solution I just had to change

img = Image.open("788.png")

to

img = Image.open("788.png").convert("RGB")
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement