# Pygifsicle
[![pip](https://badge.fury.io/py/pygifsicle.svg)](https://pypi.org/project/pygifsicle/)
[![License](https://img.shields.io/github/license/LucaCappelletti94/pygifsicle)](LICENSE)
[![downloads](https://pepy.tech/badge/pygifsicle)](https://pepy.tech/project/pygifsicle)
[![python versions](https://img.shields.io/pypi/pyversions/pygifsicle)](https://www.python.org/downloads/)
[![GitHub actions](https://github.com/LucaCappelletti94/pygifsicle/actions/workflows/python.yml/badge.svg)](https://github.com/LucaCappelletti94/pygifsicle/actions/)
Python package wrapping the [gifsicle library](https://www.lcdf.org/gifsicle/) for editing and optimizing gifs.
## How do I install this package?
As usual, just download it using pip:
```shell
pip install pygifsicle
```
While running the installation, on **MacOS** the setup will automatically install **gifsicle** using [Brew](https://brew.sh/).
On Linux you will need to install **gifsicle** using apt-get as follows:
```shell
sudo apt-get install gifsicle
```
On Windows you will need to download and install the [correct port of the library](https://eternallybored.org/misc/gifsicle/) for your OS.
## Usage examples
The library is currently pretty plain: it offers a wrapper to gifsicle and a method to optimize gifs, wrapping the options for gifsicle.
### Optimizing a gif
To optimize a gif, use the following:
```python
from pygifsicle import optimize
optimize("path_to_my_gif.gif")
```
### General wrapper
To run gifsicle from Python use the following:
```python
from pygifsicle import gifsicle
gifsicle(
sources=["list.gif", "of.gif", "gifs.gif"], # or a single_file.gif
destination="destination.gif", # or just omit it and will use the first source provided.
optimize=False, # Whether to add the optimize flag or not
colors=256, # Number of colors to use
options=["--verbose"] # Options to use.
)
```
Learn more about the general wrapper [by reading the function documentation](https://github.com/LucaCappelletti94/pygifsicle/blob/0c7a1928eb0a5eb3dc99c46c227f970c7bd6b31b/pygifsicle/pygifsicle.py#L8).
## Troubleshooting
One of the most common issues you can get, especially on Windows, is that simply the **gifsicle** library is not available system-wide. Do try to run `gifsicle` in your terminal to check if the library is properly installed.
## Help and support
Wanna add another wrapper for easier usage? [Do a pull request!](https://github.com/LucaCappelletti94/pygifsicle/pulls)
Did you find an error or weird behavior? [Open an issue!](https://github.com/LucaCappelletti94/pygifsicle/issues)
Raw data
{
"_id": null,
"home_page": "https://github.com/LucaCappelletti94/pygifsicle",
"name": "pygifsicle",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": null,
"author": "Luca Cappelletti",
"author_email": "cappelletti.luca94@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/d0/43/e3d2b8922257902ce86fce33a860b2459de0d9257521cc1f1a0d9929ecc5/pygifsicle-1.1.0.tar.gz",
"platform": null,
"description": "# Pygifsicle\n\n[![pip](https://badge.fury.io/py/pygifsicle.svg)](https://pypi.org/project/pygifsicle/)\n[![License](https://img.shields.io/github/license/LucaCappelletti94/pygifsicle)](LICENSE)\n[![downloads](https://pepy.tech/badge/pygifsicle)](https://pepy.tech/project/pygifsicle)\n[![python versions](https://img.shields.io/pypi/pyversions/pygifsicle)](https://www.python.org/downloads/)\n[![GitHub actions](https://github.com/LucaCappelletti94/pygifsicle/actions/workflows/python.yml/badge.svg)](https://github.com/LucaCappelletti94/pygifsicle/actions/)\n\nPython package wrapping the [gifsicle library](https://www.lcdf.org/gifsicle/) for editing and optimizing gifs.\n\n## How do I install this package?\n\nAs usual, just download it using pip:\n\n```shell\npip install pygifsicle\n```\n\nWhile running the installation, on **MacOS** the setup will automatically install **gifsicle** using [Brew](https://brew.sh/).\n\nOn Linux you will need to install **gifsicle** using apt-get as follows:\n\n```shell\nsudo apt-get install gifsicle\n```\n\nOn Windows you will need to download and install the [correct port of the library](https://eternallybored.org/misc/gifsicle/) for your OS.\n\n## Usage examples\n\nThe library is currently pretty plain: it offers a wrapper to gifsicle and a method to optimize gifs, wrapping the options for gifsicle.\n\n### Optimizing a gif\n\nTo optimize a gif, use the following:\n\n```python\nfrom pygifsicle import optimize\noptimize(\"path_to_my_gif.gif\")\n```\n\n### General wrapper\n\nTo run gifsicle from Python use the following:\n\n```python\nfrom pygifsicle import gifsicle\ngifsicle(\n sources=[\"list.gif\", \"of.gif\", \"gifs.gif\"], # or a single_file.gif\n destination=\"destination.gif\", # or just omit it and will use the first source provided.\n optimize=False, # Whether to add the optimize flag or not\n colors=256, # Number of colors to use\n options=[\"--verbose\"] # Options to use.\n)\n```\n\nLearn more about the general wrapper [by reading the function documentation](https://github.com/LucaCappelletti94/pygifsicle/blob/0c7a1928eb0a5eb3dc99c46c227f970c7bd6b31b/pygifsicle/pygifsicle.py#L8).\n\n## Troubleshooting\n\nOne of the most common issues you can get, especially on Windows, is that simply the **gifsicle** library is not available system-wide. Do try to run `gifsicle` in your terminal to check if the library is properly installed.\n\n## Help and support\n\nWanna add another wrapper for easier usage? [Do a pull request!](https://github.com/LucaCappelletti94/pygifsicle/pulls)\n\nDid you find an error or weird behavior? [Open an issue!](https://github.com/LucaCappelletti94/pygifsicle/issues)\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python package wrapping the gifsicle library for editing and optimizing gifs.",
"version": "1.1.0",
"project_urls": {
"Homepage": "https://github.com/LucaCappelletti94/pygifsicle"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d043e3d2b8922257902ce86fce33a860b2459de0d9257521cc1f1a0d9929ecc5",
"md5": "977ce73e4b1cce0829a9452a45ff3e57",
"sha256": "dcef433520ace4c1136dfc7060e77042142a3dbd6bdb6a19bd9149ef5cbe7441"
},
"downloads": -1,
"filename": "pygifsicle-1.1.0.tar.gz",
"has_sig": false,
"md5_digest": "977ce73e4b1cce0829a9452a45ff3e57",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 5412,
"upload_time": "2024-07-06T19:43:20",
"upload_time_iso_8601": "2024-07-06T19:43:20.136589Z",
"url": "https://files.pythonhosted.org/packages/d0/43/e3d2b8922257902ce86fce33a860b2459de0d9257521cc1f1a0d9929ecc5/pygifsicle-1.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-06 19:43:20",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "LucaCappelletti94",
"github_project": "pygifsicle",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pygifsicle"
}