A Python script to pad images to match a specified aspect ratio while ensuring a minimum amount of padding around the image relative to its size. It supports multiple image formats and preserves transparency for PNG, GIF, and WEBP files.
Note the script does not resize images, it will only add padding as needed.
- Maintains the specified aspect ratio (e.g.,
4:3
,16:9
) across all images. - Ensures a minimum padding percentage based on the largest image dimension.
- Supports PNG transparency; other formats get a white background.