Skip to content

Commit 1eb2204

Browse files
committed
update
1 parent b3047d3 commit 1eb2204

9 files changed

Lines changed: 27 additions & 0 deletions

File tree

img/projects/concept-art/--.png

1.49 KB
Loading

img/projects/concept-art/33.jpg

-272 KB
Loading

img/projects/concept-art/34.png

15 KB
Loading

img/projects/concept-art/35.jpg

-896 KB
Binary file not shown.

img/projects/concept-art/35.png

2.67 MB
Loading

img/projects/concept-art/43.png

33.3 KB
Loading

img/projects/graphic-design/17.jpg

1.08 MB
Loading

img/projects/graphic-design/17.png

-36.6 MB
Binary file not shown.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import os
2+
from PIL import Image
3+
4+
def quick_optimize():
5+
filename = input("17").strip()
6+
base_name = filename.split('.')[0]
7+
8+
found_file = None
9+
for ext in ['jpg','jpeg','png','JPG','PNG']:
10+
f = f"{base_name}.{ext}"
11+
if os.path.exists(f):
12+
found_file = f
13+
break
14+
15+
if not found_file:
16+
print("❌ الملف غير موجود")
17+
return
18+
19+
original_size = os.path.getsize(found_file)
20+
img = Image.open(found_file).convert("RGB")
21+
out = f"optimized_{found_file}"
22+
img.save(out, optimize=True, quality=80)
23+
new_size = os.path.getsize(out)
24+
25+
print(f"✅ {original_size//1024}KB → {new_size//1024}KB")
26+
27+
quick_optimize()

0 commit comments

Comments
 (0)