Canberk URUŞ
Canberk URUŞ

Reputation: 1

Python Image Scaling

I'm trying to scale a screenshot using this code :

im = Image.open(img_path)
im = im.resize((newWidth,newHeight),Image.ANTIALIAS)

but this results in a very low quality image especially texts are impossible to read

Original

Click for original Image

Scaled

Click for scaled Image

I have tried other algorithms in PIL but none of them gives the result I wanted.

I actually tried to resize my images inside Office PowerPoint and texts are clear and readable.

PowerPoint scaled

Click for Office scaled Image

Are there any other ways which I can scale the Images ?

Upvotes: 0

Views: 132

Answers (1)

Mert Karagöz
Mert Karagöz

Reputation: 71

it had worked for me.

import imutils 
im = imutils.resize(im, width=Image.ANTIALIAS)

if you want for details, you can examine https://www.programcreek.com/python/example/93640/imutils.resize

Upvotes: 1

Related Questions