gifanimator


Namegifanimator JSON
Version 1.0.8 PyPI version JSON
download
home_pagehttps://github.com/djstompzone/gifanimator
SummaryExtensible library for applying animated effects to still images and generating GIFs
upload_time2025-01-29 09:32:44
maintainerDJ Stomp
docs_urlNone
authorDJ Stomp
requires_python<4.0,>=3.10
licenseMIT
keywords pillow image editing gif transparency animation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # GIF Animator

A Python library for applying animated effects to still images and generating GIFs with **alpha transparency**.

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

## Features

- **Extensible API**: Easily add new animation effects.
- **Preserves Transparency**: Ensures smooth rendering with RGBA images.
- **CLI Support**: Apply effects from the command line.

### Supported Animations

At this time, supported animations are:

- **Jitter**: Adds a random shaking effect to images.

## Installation

### Via PyPi

```sh
pip install gifanimator
```

### Via GitHub (developers)

Clone the repository and install dependencies:

```sh
git clone https://github.com/DJStompZone/gifanimator.git
cd gifanimator
pip install .
```

## Usage

### CLI Usage

Generate a jittery animated GIF:

```bash
gifanimator input.png output.gif --params '{"effect": "jitter", "duration": 2, "params": {"frames": 10, "max_shift": 5}}'
```

Generate a **really** jittery animated GIF:

```bash
gifanimator input.png output.gif --params '{"effect": "jitter", "duration": 2, "params": {"frames": 10, "max_shift": 5}}'  --params '{"effect": "jitter", "duration": 4, "params": {"frames": 30, "max_shift": 15}}'
```

**Note:** As seen above, multiple effects can be applied by appending more than one `--params` argument

### Programmatic Usage

```py
from PIL import Image
from gifanimator.jitter_animation import JitterAnimation
from gifanimator.gif_animator import GIFAnimator

img = Image.open("input.png").convert("RGBA")

effect = JitterAnimation(frames=10, max_shift=5)
animator = GIFAnimator(effect)

animator.generate_gif(img, "output.gif")
print("GIF saved as output.gif")
```

## Contributions

### Adding New Effects

1. Create a new animation class by subclassing BaseAnimation.
2. Implement the apply() method to return a list of frames.
3. Register the effect in ANIMATION_CLASSES in **main**.py.

Example:

```py
class MyCustomAnimation(BaseAnimation):
    def apply(self, image):
        # Custom frame processing logic
        return [image]  # Return modified frames
```

### Running Tests

Ensure everything works as expected with:

```bash
pytest tests
```

## License

MIT License. See the [LICENSE](LICENSE) file for details.

<hr>

<div align="center"><br><img src="https://i.imgur.com/hjzic92.png"/>
<h1><a href="https://github.com/djstompzone"><img src="https://img.shields.io/github/stars/DJStompZone?label=DJStompZone%20%7C%20Stars"/></a><br><a href="https://discord.stomp.zone"><img src="https://img.shields.io/discord/599808270655291403?logo=discord&label=StompZone%20Discord"/></a><br><a href="https://youtube.com/@djstompzone"><img src="https://img.shields.io/youtube/channel/views/UCVmIXrlXjpzJTGkANYlTxaQ"/></a></h1></div>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/djstompzone/gifanimator",
    "name": "gifanimator",
    "maintainer": "DJ Stomp",
    "docs_url": null,
    "requires_python": "<4.0,>=3.10",
    "maintainer_email": "85457381+DJStompZone@users.noreply.github.com",
    "keywords": "pillow, image, editing, gif, transparency, animation",
    "author": "DJ Stomp",
    "author_email": "85457381+DJStompZone@users.noreply.github.com",
    "download_url": "https://files.pythonhosted.org/packages/32/6a/5e2a07bf6209b5605310336f34b8dc048b8f1ab6f69b957952e29aa97cd8/gifanimator-1.0.8.tar.gz",
    "platform": null,
    "description": "# GIF Animator\n\nA Python library for applying animated effects to still images and generating GIFs with **alpha transparency**.\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n## Features\n\n- **Extensible API**: Easily add new animation effects.\n- **Preserves Transparency**: Ensures smooth rendering with RGBA images.\n- **CLI Support**: Apply effects from the command line.\n\n### Supported Animations\n\nAt this time, supported animations are:\n\n- **Jitter**: Adds a random shaking effect to images.\n\n## Installation\n\n### Via PyPi\n\n```sh\npip install gifanimator\n```\n\n### Via GitHub (developers)\n\nClone the repository and install dependencies:\n\n```sh\ngit clone https://github.com/DJStompZone/gifanimator.git\ncd gifanimator\npip install .\n```\n\n## Usage\n\n### CLI Usage\n\nGenerate a jittery animated GIF:\n\n```bash\ngifanimator input.png output.gif --params '{\"effect\": \"jitter\", \"duration\": 2, \"params\": {\"frames\": 10, \"max_shift\": 5}}'\n```\n\nGenerate a **really** jittery animated GIF:\n\n```bash\ngifanimator input.png output.gif --params '{\"effect\": \"jitter\", \"duration\": 2, \"params\": {\"frames\": 10, \"max_shift\": 5}}'  --params '{\"effect\": \"jitter\", \"duration\": 4, \"params\": {\"frames\": 30, \"max_shift\": 15}}'\n```\n\n**Note:** As seen above, multiple effects can be applied by appending more than one `--params` argument\n\n### Programmatic Usage\n\n```py\nfrom PIL import Image\nfrom gifanimator.jitter_animation import JitterAnimation\nfrom gifanimator.gif_animator import GIFAnimator\n\nimg = Image.open(\"input.png\").convert(\"RGBA\")\n\neffect = JitterAnimation(frames=10, max_shift=5)\nanimator = GIFAnimator(effect)\n\nanimator.generate_gif(img, \"output.gif\")\nprint(\"GIF saved as output.gif\")\n```\n\n## Contributions\n\n### Adding New Effects\n\n1. Create a new animation class by subclassing BaseAnimation.\n2. Implement the apply() method to return a list of frames.\n3. Register the effect in ANIMATION_CLASSES in **main**.py.\n\nExample:\n\n```py\nclass MyCustomAnimation(BaseAnimation):\n    def apply(self, image):\n        # Custom frame processing logic\n        return [image]  # Return modified frames\n```\n\n### Running Tests\n\nEnsure everything works as expected with:\n\n```bash\npytest tests\n```\n\n## License\n\nMIT License. See the [LICENSE](LICENSE) file for details.\n\n<hr>\n\n<div align=\"center\"><br><img src=\"https://i.imgur.com/hjzic92.png\"/>\n<h1><a href=\"https://github.com/djstompzone\"><img src=\"https://img.shields.io/github/stars/DJStompZone?label=DJStompZone%20%7C%20Stars\"/></a><br><a href=\"https://discord.stomp.zone\"><img src=\"https://img.shields.io/discord/599808270655291403?logo=discord&label=StompZone%20Discord\"/></a><br><a href=\"https://youtube.com/@djstompzone\"><img src=\"https://img.shields.io/youtube/channel/views/UCVmIXrlXjpzJTGkANYlTxaQ\"/></a></h1></div>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Extensible library for applying animated effects to still images and generating GIFs",
    "version": "1.0.8",
    "project_urls": {
        "Discord": "https://discord.stomp.zone",
        "Documentation": "https://github.com/DJStompZone/gifanimator/blob/main/README.md",
        "Homepage": "https://github.com/djstompzone/gifanimator",
        "Repository": "https://github.com/djstompzone/gifanimator"
    },
    "split_keywords": [
        "pillow",
        " image",
        " editing",
        " gif",
        " transparency",
        " animation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5e69e18665a4116d6883c9e58f7e8f8cf58126c2d696c8f2ad8354b4e137acc8",
                "md5": "d51e463656b62e026f338b107dde369f",
                "sha256": "bc69558da984640bfb4d09d9b875cb72918162ce8641479c01a8b583e83d2d3d"
            },
            "downloads": -1,
            "filename": "gifanimator-1.0.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d51e463656b62e026f338b107dde369f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.10",
            "size": 7453,
            "upload_time": "2025-01-29T09:32:42",
            "upload_time_iso_8601": "2025-01-29T09:32:42.916664Z",
            "url": "https://files.pythonhosted.org/packages/5e/69/e18665a4116d6883c9e58f7e8f8cf58126c2d696c8f2ad8354b4e137acc8/gifanimator-1.0.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "326a5e2a07bf6209b5605310336f34b8dc048b8f1ab6f69b957952e29aa97cd8",
                "md5": "0d51ac730397d2ce302a3a1c5e8b74b9",
                "sha256": "dbe8dbb64f03ad5b2858531c68191a1b1b68f6f3a85797048f5c36fb7966c060"
            },
            "downloads": -1,
            "filename": "gifanimator-1.0.8.tar.gz",
            "has_sig": false,
            "md5_digest": "0d51ac730397d2ce302a3a1c5e8b74b9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.10",
            "size": 5563,
            "upload_time": "2025-01-29T09:32:44",
            "upload_time_iso_8601": "2025-01-29T09:32:44.490918Z",
            "url": "https://files.pythonhosted.org/packages/32/6a/5e2a07bf6209b5605310336f34b8dc048b8f1ab6f69b957952e29aa97cd8/gifanimator-1.0.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-29 09:32:44",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "djstompzone",
    "github_project": "gifanimator",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "gifanimator"
}
        
Elapsed time: 1.11007s