0
votes

I have an image in JPEG which contains a solid black circle on top of a solid black inverted equilateral triangle.

Upon application of Python PIL Image class, function thumbnail, resizing from 500*500 to 100*100 the shape of the image components change from (circle+triangle) to (rectangle+rectangle), almost looks like the android icon now.

Any ideas why this is happening? I'm guessing this is an algorithm issue.

Here's the code:

im = Image.open('E:/asdsa/aret/sdfssdf/media/edasdaas1d0-1.jpeg')
im.thumbnail((100,100), Image.ANTIALIAS)
im.save('E:/asdsa/aret/sdfssdf/media/11.jpeg')
1

1 Answers

1
votes

Try

im.save('E:/asdsa/aret/sdfssdf/media/11.jpeg', quality=90)

Anyway, it's better to use Pillow.

Also, for solid colors jpeg format might not be the best choice. PNG is a better solution.