A simple and educational Python project that generates an animated GIF from a series of images, while showcasing best practices in image processing, file handling, and user interaction.

Naruto GIF Generator
Create animated GIFs from images with Python
This project has enabled me to learn to :
- Manipulating image files with the library
imageio - Using regular expressions to clean up file names
- Manage file paths in a portable way with
pathlib - Dynamically create a GIF file from local images
- Apply good Python development practices:
- Error handling(
try/except) - Automatic directory creation
- Secure user input
- Code readability and structure
- Error handling(
| Technologie | Usage |
|---|---|
Python 3.13 |
Main language |
imageio.v3 |
Reading/writing images and creating GIFs |
pathlib |
Modern file path management |
re |
Cleaning up filenames with regular expressions |
datetime |
Inserting the date in the name of the generated file |
- ๐ Generates an animated GIF from images in a folder
images/ - ๐งผ Automatically cleans up GIF file names to avoid forbidden characters
- ๐ Automatically creates the
gif_generate/si inexistant - ๐ Adds today's date to the file name to prevent overwriting
- ๐ Handles errors caused by missing or illegible files
- ๐ง Code that is structured, commented, readable and easy to modify
naruto-gif-generator/
โ
โโโ images/ # Contains source images
โ โโโ naruto1.jpg
โ โโโ ...
โ
โโโ gif_generate/ # Contains the generated GIF
โ โโโ naruto_<date>.gif
โ
โโโ create_gif.py # Main script
โโโ README.md # Project description (you are here)
- Place your images in the
images/ - Run the script :
python3 create_gif.py- Give your GIF a name when requested
- The file will be generated in
gif_generate/
Give me the name you want for your gif : naruto_final
โ
GIF generated successfully at: gif_generate/naruto_final_2025-04-06.gif
- Clone this repository :
git clone https://github.com/ton-nom-utilisateur/Create-a-GIF-with-Python.git2.Installs dependencies:
pip install imageio| Expertise | Learned |
|---|---|
| Use of third-party libraries (imageio) | โ |
| Secure cleaning of user input (regex) | โ |
File creation and path management(pathlib) |
โ |
| Robust scripts with error handling | โ |
| Python project structuring | โ |
| Continuous integration possible | โ |
- Interface graphique (Tkinter / PyQt)
- If you have any ideas, don't hesitate to contact us.
- ๐Codedex.io the best site for learning