Skip to content

This Python script converts a series of PNG images into a GIF animation.

License

Notifications You must be signed in to change notification settings

long-910/png2gif

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PNG to GIF Converter

Python package

This Python script converts a series of PNG images into a GIF animation.

Requirements

  • Python 3.x
  • Pillow library (pip install pillow)

Installation

You can install the package using pip:

pip install .

Usage

Command Line Interface

After installation, you can use the command line interface (CLI) to convert PNG images to GIF.

png2gif input_path output_filename --frame_rate 10
  • input_path: Path to the directory containing PNG images.
  • output_filename: Name of the output GIF file.
  • --frame_rate: Frame rate of the output GIF (default: 10 FPS).

Direct Execution

You can also execute the package directly without installation:

python -m png2gif input_path output_filename --frame_rate 10

Module Usage

If you prefer to use the package as a module in your Python code:

from png2gif import create_gif

input_path = "path/to/input_directory"
output_filename = "output.gif"
frame_rate = 10

create_gif(input_path, output_filename, frame_rate)

Development

Running Tests

pytest

You can run the tests using pytest:

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for bug fixes, feature requests, or general improvements.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

This Python script converts a series of PNG images into a GIF animation.

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published

Languages