A lightweight python tool for creating GIFs
Project description
gifing
A lightweight python tool for creating GIFs
from gifing import Gif
path = "tests/img"
file_path = [f"{path}/image{i}.jpg" for i in range(1, 4)]
gif = Gif(
file_path,
frame_duration=800,
n_repeat_last_frame=3,
)
gif.set_labels(
["print", "hello", "world"],
font_size=60,
loc="bottom left",
text_padding=40,
box_padding=20,
box_color="#fffcee",
shadow_offset=15,
font="Urbanist",
)
gif.set_background_color("red")
gif.set_size((900, 700), scale=1)
gif.make("img/output.gif")
This package offers:
- a streamlined approach to creating GIFs
- automatic image resizing
- ability to set a background color during resizing
- frame-by-frame label customization
It's a basic prototype of the functionality I envision for this tool. The API is still unstable.
Installation
Install directly via pip (requires Python >=3.10):
pip install git+https://github.com/JosephBARBIERDARNAL/gifing.git
Usage
Import the Gif class and provide a list of image file paths:
from gifing import Gif
path = "tests/img"
gif = Gif(
[f"{path}/image{i}.jpg" for i in range(1, 4)],
frame_duration=800, # Duration per frame (in milliseconds)
n_repeat_last_frame=3, # Repeat last frame 3x longer
)
You can set a background color, which is useful if your images have varying sizes:
gif.set_background_color("black")
You can also set a custom size for your GIF. The set_size method allows you to specify a target size and scale factor:
gif.set_size((300, 800), scale=1) # Set the size to (300, 800) with no scaling
Finally, call the make() method to generate the GIF:
gif.make()
By default, the GIF will be saved as ./output.gif. You can customize the output path by passing it as an argument to the make() method.
License
- The source code in this repository is licensed under the MIT License.
- The included fonts are licensed under the SIL Open Font License, Version 1.1.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gifing-0.1.0.tar.gz.
File metadata
- Download URL: gifing-0.1.0.tar.gz
- Upload date:
- Size: 5.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be5b2e38d3d570aeed0ef0a0708057e8559cb1d8b1b766ab2d2935834d543854
|
|
| MD5 |
43a4179796e136eb2ba42fccd710e9ec
|
|
| BLAKE2b-256 |
17f942cc7e8cfd26d96793d03ce7e8555b6f47bd1d7b836cee248d6c0c7bfd66
|
Provenance
The following attestation bundles were made for gifing-0.1.0.tar.gz:
Publisher:
pypi.yaml on y-sunflower/gifing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gifing-0.1.0.tar.gz -
Subject digest:
be5b2e38d3d570aeed0ef0a0708057e8559cb1d8b1b766ab2d2935834d543854 - Sigstore transparency entry: 219612808
- Sigstore integration time:
-
Permalink:
y-sunflower/gifing@6dd7e574d72e3504e297cb9a88aaa6f549123f85 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/y-sunflower
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@6dd7e574d72e3504e297cb9a88aaa6f549123f85 -
Trigger Event:
push
-
Statement type:
File details
Details for the file gifing-0.1.0-py3-none-any.whl.
File metadata
- Download URL: gifing-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a05fea0c1bd24d834931f1ab2138b9c0786bae7544f9efaed34234970fa24eb6
|
|
| MD5 |
2eca2db0912858c53d49ec1669213f3f
|
|
| BLAKE2b-256 |
adee30e0a4023bf4d7f7623ec5e2d3dd32b81fdec7237d13fdca44d53fb8483c
|
Provenance
The following attestation bundles were made for gifing-0.1.0-py3-none-any.whl:
Publisher:
pypi.yaml on y-sunflower/gifing
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gifing-0.1.0-py3-none-any.whl -
Subject digest:
a05fea0c1bd24d834931f1ab2138b9c0786bae7544f9efaed34234970fa24eb6 - Sigstore transparency entry: 219612810
- Sigstore integration time:
-
Permalink:
y-sunflower/gifing@6dd7e574d72e3504e297cb9a88aaa6f549123f85 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/y-sunflower
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@6dd7e574d72e3504e297cb9a88aaa6f549123f85 -
Trigger Event:
push
-
Statement type: