A lightweight Python tool that extracts all `.jpg`, `.jpeg`, and `.png` images from a selected folder (including subfolders), and copies them into a new folder named `extracted_images`. Duplicate image names are automatically renamed to avoid overwriting.
Have you ever had to sift through dozens (or hundreds!) of folders just to collect a bunch of images scattered everywhere? Maybe youβre organizing a design project, cleaning up your downloads, or collecting assets for a presentation. Doing this manually is a total drag β and thatβs exactly why I built this tool!
Image Extractor Tool is a small Python utility that lets you select any folder and automatically extracts all .jpg
, .jpeg
, and .png
files β even from subfolders. All the found images are neatly copied into a new folder called extracted_images
.
And the best part? If there are duplicate filenames (like multiple cat.jpg
files), the tool renames them smartly to cat_1.jpg
, cat_2.jpg
, and so on. No overwrites, no headaches!
Β
While checking on my archived college images, I saw tons of images in different folders with duplicate names. I needed a way to:
Instead of doing it manually, I thought β letβs make a Python script do the work! π―
Β
The tool uses Pythonβs built-in modules (os
, shutil
, and tkinter
) to:
.jpg
, .jpeg
, .png
filesextracted_images/
, renaming if neededNo third-party libraries required. It's clean and fast!
Β
Letβs say you select this folder:
π /project/
Β βββ folder1/cat.jpg
Β βββ folder2/cat.jpg
Β βββ folder3/dog.png
After running the script, it will create:
π /project/extracted_images/
Β βββ cat.jpg
Β βββ cat_1.jpg
Β βββ dog.png
β¨ Boom! All your images are in one place.
Β
You can check out the full code, README, and instructions here:
π GitHub Repo β https://github.com/codersattu/ImageExtractorFromFolder
Β
Feeling creative? Here are a few features you could add:
.webp
, .gif
, .bmp
PyInstaller
Β
This project was a fun mix of automation, GUI programming, and file system logic. Itβs a great mini-project if you're learning Python or want something useful in your toolbelt.
If you find it helpful or improve it, Iβd love to see your version! π
Letβs make file organizing a little less painful and a lot more Pythonic.
Β
Need help setting it up or want a .exe version? Drop a comment or reach out. Happy coding! ππ‘
Your email address will not be published. Required fields are marked *