Pengubah Ukuran Gambar
Ubah ukuran gambar ke dimensi apa pun di browser Anda β tanpa upload ke server.
Pertanyaan yang Sering Diajukan
Implementasi Kode
from PIL import Image
# Open and resize to exact dimensions
img = Image.open("input.jpg")
resized = img.resize((800, 600), Image.LANCZOS)
resized.save("output.jpg")
# Resize to percentage (50%)
width, height = img.size
half = img.resize((width // 2, height // 2), Image.LANCZOS)
half.save("half_size.jpg")
# Resize maintaining aspect ratio (max width 800)
img.thumbnail((800, 800), Image.LANCZOS)
img.save("thumbnail.jpg")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.