🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101

Bulk image resizer and watermarker

Resize, compress and watermark hundreds of photos at once, ready for a website or Instagram.

Beginner⏱ 3–5 hoursđŸĒœ 7 stepsPythonPillow

What you'll learn

  • ◆Image processing with Pillow
  • ◆Batch processing folders
  • ◆Keeping aspect ratio and EXIF rotation

What you'll build

  • ✓Resize to a max width keeping aspect ratio
  • ✓Convert to WebP or JPEG with a quality setting
  • ✓Add a text or logo watermark
  • ✓Shows saved space at the end

Step-by-step guide

  1. 1

    Install Pillow

    pip install Pillow; open an image with Image.open(path).

  2. 2

    Fix rotation

    Call ImageOps.exif_transpose(img) so phone photos are not sideways.

  3. 3

    Resize

    Use img.thumbnail((max_w, max_w * 10)) which keeps the aspect ratio and never upscales.

  4. 4

    Watermark

    Create an RGBA layer, draw text with ImageDraw.text and a semi-transparent fill, or paste a logo PNG with its alpha mask, then alpha_composite.

  5. 5

    Save compressed

    img.convert("RGB").save(out, "JPEG", quality=80, optimize=True) or format "WEBP".

  6. 6

    Process a folder

    Loop over Path(src).glob("*.[jp][pn]g"), write to an output folder and keep a running total of bytes before and after.

  7. 7

    Add options

    argparse flags: --width, --quality, --format, --watermark "text".

🚀 Make it stand out

  • +Use concurrent.futures to process in parallel
  • +Add a drag-and-drop Tkinter window
  • +Generate square thumbnails for a gallery