DEV Community


Posted on


Compress image in python

Yesterday i wrote a article in Dev about

Google Chrome Extension

I upload sample images of the Google Chrome Extension - New Tab a New Quote but it fails, i tried it multiple time, because of the file size and the network problem which i faced.
So i decided to compress the image using python

   from PIL import Image
   path = "img/Screenshot 6.png"
   image =
   image = image.convert('RGB')"img/Screenshot 6e.jpg",quality=20,optimize=True)
Enter fullscreen mode Exit fullscreen mode

you can see the difference
Alt Text


Alt Text


Alt Text

Thanks you, have a great day ahead.๐Ÿ˜Ž

Top comments (0)

Super Useful CSS Resources

A collection of 70 hand-picked, web-based tools which are actually useful.
Each will generate pure CSS without the need for JS or any external libraries.