mirror of
https://github.com/hastagAB/Awesome-Python-Scripts.git
synced 2025-02-06 16:40:54 +00:00
parent
7784de4959
commit
f1ba8a5c95
|
@ -1,17 +1,4 @@
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
import PIL
|
|
||||||
from PIL import Image
|
|
||||||
from tkinter.filedialog import *
|
|
||||||
|
|
||||||
file_path=askopenfilenames()
|
|
||||||
img = PIL.Image.open(file_path)
|
|
||||||
myHeight,myWidth = img.size
|
|
||||||
|
|
||||||
img=img.resize((myHeight,myWidth),PIL.Image.ANTILIAS)
|
|
||||||
save_path=asksaveasfile()
|
|
||||||
|
|
||||||
img.save(save_path+"_compressed.JPG")
|
|
||||||
=======
|
|
||||||
import PIL
|
import PIL
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
from tkinter.filedialog import *
|
from tkinter.filedialog import *
|
||||||
|
@ -24,6 +11,32 @@ img=img.resize((myHeight,myWidth),PIL.Image.ANTILIAS)
|
||||||
save_path=asksaveasfile()
|
save_path=asksaveasfile()
|
||||||
|
|
||||||
img.save(save_path+"_compressed.JPG")
|
img.save(save_path+"_compressed.JPG")
|
||||||
|
=======
|
||||||
|
import PIL
|
||||||
|
from PIL import Image
|
||||||
|
from tkinter.filedialog import *
|
||||||
|
|
||||||
|
file_path = askopenfilenames()
|
||||||
|
img = PIL.Image.open(file_path)
|
||||||
|
myHeight, myWidth = img.size
|
||||||
|
|
||||||
|
img = img.resize((myHeight, myWidth), PIL.Image.ANTILIAS)
|
||||||
|
save_path = asksaveasfile()
|
||||||
|
|
||||||
|
img.save(save_path + "_compressed.JPG")
|
||||||
|
|
||||||
|
import PIL
|
||||||
|
from PIL import Image
|
||||||
|
from tkinter.filedialog import *
|
||||||
|
|
||||||
|
file_path = askopenfilenames()
|
||||||
|
img = PIL.Image.open(file_path)
|
||||||
|
myHeight, myWidth = img.size
|
||||||
|
|
||||||
|
img = img.resize((myHeight, myWidth), PIL.Image.ANTILIAS)
|
||||||
|
save_path = asksaveasfile()
|
||||||
|
|
||||||
|
img.save(save_path + "_compressed.JPG")
|
||||||
|
|
||||||
import PIL
|
import PIL
|
||||||
from PIL import Image
|
from PIL import Image
|
||||||
|
@ -37,11 +50,33 @@ if len(file_paths) == 0:
|
||||||
for file in file_paths:
|
for file in file_paths:
|
||||||
file_name = file.split('/')[-1]
|
file_name = file.split('/')[-1]
|
||||||
file_name, extension = file_name.split('.')
|
file_name, extension = file_name.split('.')
|
||||||
|
|
||||||
|
img = PIL.Image.open(file)
|
||||||
|
height, width = img.size
|
||||||
|
img = img.resize((height, width), Image.Resampling.LANCZOS)
|
||||||
|
|
||||||
|
save_path = askdirectory()
|
||||||
|
img.save(save_path + f"/{file_name}_compressed.{extension}")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
import PIL
|
||||||
|
from PIL import Image
|
||||||
|
from tkinter.filedialog import *
|
||||||
|
|
||||||
|
file_paths = askopenfilenames()
|
||||||
|
|
||||||
|
if len(file_paths) == 0:
|
||||||
|
print("No Files Selected")
|
||||||
|
|
||||||
|
for file in file_paths:
|
||||||
|
file_name = file.split('/')[-1]
|
||||||
|
file_name, extension = file_name.split('.')
|
||||||
|
|
||||||
img = PIL.Image.open(file)
|
img = PIL.Image.open(file)
|
||||||
height,width = img.size
|
height,width = img.size
|
||||||
img=img.resize((height,width),Image.Resampling.LANCZOS)
|
img=img.resize((height,width),Image.Resampling.LANCZOS)
|
||||||
|
|
||||||
save_path=askdirectory()
|
save_path=askdirectory()
|
||||||
img.save(save_path+f"/{file_name}_compressed.{extension}")
|
img.save(save_path+f"/{file_name}_compressed.{extension}")
|
||||||
>>>>>>> 06c603fe31712b13e986e2f388b82a8ab3703308
|
>>>>>>> 06c603fe31712b13e986e2f388b82a8ab3703308
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
<<<<<<< HEAD
|
<<<<<<< HEAD
|
||||||
astroid==2.1.0
|
astroid==2.1.0
|
||||||
autopep8==1.4.3
|
autopep8==1.4.3
|
||||||
certifi==2022.12.7
|
certifi==2022.12.7
|
||||||
colorama==0.4.1
|
colorama==0.4.1
|
||||||
isort==4.3.4
|
isort==4.3.4
|
||||||
lazy-object-proxy==1.3.1
|
lazy-object-proxy==1.3.1
|
||||||
mccabe==0.6.1
|
mccabe==0.6.1
|
||||||
pycodestyle==2.4.0
|
pycodestyle==2.4.0
|
||||||
pylint==2.2.2
|
pylint==2.2.2
|
||||||
pynput==1.4.4
|
pynput==1.4.4
|
||||||
six==1.12.0
|
six==1.12.0
|
||||||
wincertstore==0.2
|
wincertstore==0.2
|
||||||
wrapt==1.10.11
|
wrapt==1.10.11
|
||||||
=======
|
=======
|
||||||
astroid==2.1.0
|
astroid==2.1.0
|
||||||
autopep8==1.4.3
|
autopep8==1.4.3
|
||||||
|
|
Loading…
Reference in New Issue
Block a user