mirror of
https://github.com/metafy-social/python-scripts.git
synced 2024-11-30 15:31:10 +00:00
11 lines
416 B
Python
11 lines
416 B
Python
|
from PIL import Image as img
|
||
|
import os
|
||
|
|
||
|
file_name = input("Enter anpe of file: ")
|
||
|
name , ext = file_name.split('.')
|
||
|
pic = img.open((os.path.join(os.path.dirname(os.path.abspath(__file__)),file_name)))
|
||
|
|
||
|
ht, wt= input("Enter dimenstions(eg: 1024x720): ").split('x')
|
||
|
dim = int(ht), int(wt)
|
||
|
img_resize = pic.resize(dim)
|
||
|
img_resize.save((os.path.join(os.path.dirname(os.path.abspath(__file__)),f'{name}_resized.{ext}')))
|