The problem
I needed a simple tool to convert images from PNG and JPG to WEBP format. WEBP files are significantly smaller, making them ideal for web pages where load speed matters. I tried using one of those free online conversion websites, but the experience was terrible. The site was plastered with intrusive ads, ran slowly, and sometimes just stopped working entirely. Every time I needed to convert a few images, it felt like a chore instead of a quick task.
I knew I could build something better, but the thought of spending hours researching Python image libraries, setting up a development environment, and debugging made me put it off. Then I realized: this is exactly what AI coding tools are made for.
Why this matters
This scenario represents a shift in how we approach software development. Instead of spending hours learning a library, debugging environment issues, or copy-pasting from Stack Overflow, you can describe what you need and have a working solution in minutes. The key isn't just that AI can write code—it's that AI can handle all the tedious setup, configuration, and integration work that usually keeps us from building tools we actually need.
For anyone running a website, optimizing images is non-negotiable. WEBP format typically reduces file sizes by 25-35% compared to JPEG and PNG, which directly impacts page load times, user experience, and even SEO rankings. Having a reliable, ad-free conversion tool at your fingertips makes this optimization effortless.
What I did: the step-by-step approach
Step 1: Set up the GitHub repository
First, I created a new repository on GitHub. This gives you a clean starting point and makes it easy to track changes as Claude Code builds your tool.
ACTION
- Go to GitHub and create a new repository (name it something like "image-to-webp-converter")
- Clone the repository to your local machine
- Open your terminal and navigate to the repository folder
Step 2: Start Claude Code and describe what you need
With Claude Code running in your terminal, you can describe your requirements in plain English. The more specific you are about what you need, the better the result will be.
WHAT I TOLD CLAUDE
I need a Python program that converts PNG and JPG images to WEBP format. Requirements: - Should accept a folder of images as input - Convert all PNG and JPG files to WEBP - Preserve the original image quality - Save converted files to an output folder - Show progress as it converts - Handle errors gracefully if a file can't be converted
Step 3: Let Claude Code build the solution
This is where the magic happens. Claude Code doesn't just write a single Python file—it creates a complete, working application with proper structure, error handling, and documentation.
WHAT CLAUDE CODE DELIVERS
Within minutes, Claude Code created:
- A complete Python script with the image conversion logic
- Proper command-line argument handling
- Progress indicators showing which files are being processed
- Error handling for corrupted or unsupported files
- A requirements.txt file listing dependencies (Pillow library)
- A README.md with installation and usage instructions
- Basic project structure following Python best practices
Step 4: Test and refine
The first version worked immediately, but I wanted to add a few refinements. This is where conversational AI development really shines—you can iterate quickly.
MY REFINEMENT REQUESTS
- "Can you add an option to adjust the quality level for WEBP compression?"
- "Let's add a flag to preserve the original files or delete them after conversion"
- "Can you show the file size savings for each converted image?"
Each of these requests took Claude Code less than a minute to implement. The tool became more useful with each iteration.
The real-world result
BEFORE: I was using a sketchy website with ads, pop-ups, and unreliable performance. Converting a batch of images meant uploading them one-by-one, waiting through ads, and hoping the site didn't crash.
AFTER: I have a clean command-line tool I can run from my terminal. Converting 50 images takes one command and about 5 seconds. No ads, no uploads to third-party sites, and complete control over quality settings.
ACTUAL USAGE EXAMPLE
$ python convert.py --input ./raw_images --output ./optimized --quality 85 Converting images... ✓ hero-banner.jpg → hero-banner.webp (2.3 MB → 800 KB, saved 65%) ✓ product-01.png → product-01.webp (1.8 MB → 450 KB, saved 75%) ✓ team-photo.jpg → team-photo.webp (3.1 MB → 1.2 MB, saved 61%) Completed: 47 images converted successfully Total space saved: 89.3 MB
Why this approach works so well
No prior Python experience needed
You don't need to know Python libraries or how image processing works. Claude Code handles all the technical implementation. You just need to know what you want the tool to do.
Professional-quality code from the start
The code Claude Code generates includes error handling, proper logging, command-line interfaces, and documentation. These are things that often get skipped when we're hacking together a quick script, but they make the difference between a throwaway script and a tool you'll actually use long-term.
Iterative improvement is effortless
After seeing the first version work, I could easily request additions or changes. This is much faster than searching documentation, reading tutorials, or debugging on your own.
Complete project setup
Claude Code doesn't just generate a Python file—it creates a proper project structure with dependencies, documentation, and best practices. This means you get a tool that's easy to maintain and share with others.
Key lessons for using AI coding tools effectively
SUCCESSFUL PATTERNS
- Be specific about requirements upfront: Don't just say "convert images"—specify formats, quality needs, output structure, and error handling
- Start with a GitHub repo: Version control makes it easy to experiment and roll back if needed
- Test immediately: Run the first version as soon as it's generated. Real results help you understand what to refine
- Iterate conversationally: Ask for improvements one at a time. "Can you add X?" is much clearer than redesigning everything
- Think about actual usage: Consider where you'll run this, how often, and what would make it genuinely useful
REMEMBER
- AI coding tools excel at setup, boilerplate, and integration work—the stuff that usually slows you down
- You remain the product manager—you define requirements and decide what's good enough
- Simple, working solutions beat complex, theoretical ones every time
- The goal is a tool you'll actually use, not perfect code
When this approach makes sense
This method works exceptionally well for:
- Utility scripts and automation tools: File processing, data conversion, batch operations
- Prototypes and proof-of-concepts: When you need to test an idea quickly
- Personal productivity tools: Custom solutions for repetitive tasks in your workflow
- Learning new libraries or frameworks: Get working examples you can study and modify
- Replacing sketchy online tools: Build clean, ad-free alternatives you control
The bigger picture
This image converter took me about 10 minutes from start to finish, including testing. The traditional approach—researching the Pillow library, reading documentation, setting up the project structure, debugging—would have taken hours. More importantly, I probably wouldn't have bothered, and I'd still be dealing with that ad-riddled website.
That's the real shift: AI coding tools lower the friction so much that building custom solutions becomes the obvious choice. Problems that used to require "finding a tool" or "living with it" can now be solved with "let's just build exactly what I need."
The result isn't just a tool—it's a mindset change. When creating software becomes this fast and approachable, you start seeing automation opportunities everywhere.
Try it yourself
Pick something small that's annoying you. Maybe it's renaming files, processing spreadsheets, or downloading content from a website. Describe what you need to Claude Code in clear, specific terms. Let it build a first version, test it, then iterate based on what you learn.
You'll be surprised how quickly "I wish I had a tool for this" turns into "here's the tool I built."
Complete Python code available in the download link below
Want to learn more about using AI to build practical tools and solve real problems? Check out Practical AI for Humans for comprehensive guides on prompt engineering, AI development workflows, and real-world applications that make your work easier.