Skip to content

LaudeDignus/Create-a-GIF-with-Python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒ€ Create a GIF with Pyhton

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


๐ŸŽฏ Learning objectives

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

โš™๏ธ Technologies used

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

๐Ÿ’ป Features

  • ๐Ÿ”„ 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

๐Ÿ—‚๏ธ Structure du projet

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)

โ–ถ๏ธUse

  1. Place your images in the images/
  2. Run the script :
python3 create_gif.py
  1. Give your GIF a name when requested
  2. The file will be generated in gif_generate/

๐Ÿงช Example of output

Give me the name you want for your gif : naruto_final
โœ… GIF generated successfully at: gif_generate/naruto_final_2025-04-06.gif

๐Ÿ“ฆInstallation

  1. Clone this repository :
git clone https://github.com/ton-nom-utilisateur/Create-a-GIF-with-Python.git

2.Installs dependencies:

pip install imageio

โœจWhat you can learn from this project

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 โœ…

๐Ÿ”„ Opportunities for improvement

  • Interface graphique (Tkinter / PyQt)
  • If you have any ideas, don't hesitate to contact us.

๐Ÿ™Œ Remerciements

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages