Skip to content

Latest commit

 

History

History
33 lines (28 loc) · 1.39 KB

README.md

File metadata and controls

33 lines (28 loc) · 1.39 KB

🚀 Mutiple image resize and rename with Python Pillow

What's the looks? web

Why this app you need to use?

  • This app can resize a multiple file such as jpg and png images within a second.
  • This app can edit your all file name such as images, videos within a second
  • In the time of resizing your images, this app maintain aspect ratio
  • Option also available to force resize
  • After rename your file, it's easy to sort

How the code works?

To make this, first you need to download pillow & them import to your code

from PIL import Image
import os

to maintain aspect ratio, following line will work better

i.thumbnail((200,200)) # (width,height) in pixel

to mforce the size, following line will work better

i=i.resize((200,200),Image.ANTIALIAS) # Image.ANTIALIAS forces here to make the image into 200px X 200px

In the following rename code, we have to be said the current image folder and target folder

img_source='C:\\Users\\MH HABIB\\Desktop\\python\\projet\\images\\'
img_destination='C:\\Users\\MH HABIB\\Desktop\\python\\projet\\images\\200'