🛠️ToolsShed

画像リサイズ

ブラウザ上で画像を任意のサイズに変更 — サーバーへのアップロード不要。

よくある質問

コード実装

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.