ImageEffects


NameImageEffects JSON
Version 0.0.13 PyPI version JSON
download
home_pagehttps://github.com/prashantrahul141/ImageEffects
SummaryA library to add effects to your images.
upload_time2023-01-03 10:02:29
maintainer
docs_urlNone
authorprashantrahul141
requires_python>=3.6
licenseMIT
keywords python image manipulation pillow pil
VCS
bugtrack_url
requirements Pillow art numpy
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align='center'>Image Effects</h1>

<h6 align='center'>A Simple Library to add effects to images written in python using <a target="_blank" href="https://pillow.readthedocs.io/en/stable/">Pillow</a>.</h6>

<br>

## Quick Example

```py
# import the EffectsCreator class
from ImageEffects import EffectsCreator

# initialize it
EC = EffectsCreator()

# use functions to add effects to images

# this functions overlays an image with an emoji
# the functions returns a PIL.Image.Image object
output = EC.emojioverlay('input.png', '🟥')

# save the resulted image
output.save('output.png')

# or add effects and save them.
EC.caption1('input.png', 'testing text here').save('result_two.jpg')
EC.caption2('input.png', 'testing text here').save('result_three.jpg')
EC.deepfry('input.png').save('result_four.jpg')
EC.pixelate('input.png', 2).save('result_five.jpg')
```

input file:

<img width="200px" src='https://raw.githubusercontent.com/prashantrahul141/ImageEffects/main/ImageEffects/resources/meta/test_image.jpg' alt="input">
<br>

emojioverlay:

<img width="200px" src='https://raw.githubusercontent.com/prashantrahul141/ImageEffects/main/ImageEffects/resources/meta/result_one.png' alt="emojioverlay">
<br>

caption1:

<img width="200px" src='https://raw.githubusercontent.com/prashantrahul141/ImageEffects/main/ImageEffects/resources/meta/result_two.jpg' alt="caption1">
<br>

caption2:

<img width="200px" src='https://raw.githubusercontent.com/prashantrahul141/ImageEffects/main/ImageEffects/resources/meta/result_three.jpg' alt="caption2">
<br>

deepfry:

<img width="200px" src='https://raw.githubusercontent.com/prashantrahul141/ImageEffects/main/ImageEffects/resources/meta/result_four.jpg' alt="deepfry">
<br>

pixelate:

<img width="200px" src='https://raw.githubusercontent.com/prashantrahul141/ImageEffects/main/ImageEffects/resources/meta/result_five.jpg' alt="pixelate">
<br>

## Index

- [Installation](#installation)
- [What's Next](#whats-next)

##### Functions

- [emojioverlay](#emojioverlay)
- [deepfry](#deepfry)
- [caption1](#caption1)
- [caption2](#caption2)
- [pixelate](#pixelate)
- [triggered](#triggered)
- [cropcircle](#cropcirlce)
- [blur](#blur)
- [rotate](#rotate)
- [ascify](#ascify)
- [crop](#crop)
- [resize](#resize)
- [saturate](#saturate)
- [grayscale](#grayscale)
- [flip](#flip)
- [mirror](#mirror)
- [invert](#invert)

## More Information

### Installation

Install using pip.

```sh
pip install ImageEffects
```

## Functions

### emojioverlay

Overlays an image with an emoji.

```py
emojioverlay(image: str, emoji: str, alpha: int = 100) -> Image
```

### deepfry

makes deepfry meme from image.

```py
deepfry(image: str) -> Image
```

### caption1

adds given text to the image on the top side.

```py
caption1(image: str, text: str = 'text here', _font_size_ratio_mul: float = 1.0, _border: bool = False) -> Image
```

### caption2

adds given text to the image on the bottom side.

```py
caption2(image: str, text: str = 'text here', _font_size_ratio_mul: float = 1.0, _border: bool = False) -> Image
```

### pixelate

adds pixelate effect.
`scale` should be between 0 to 6 ( including 0 and 6)

```py
pixelate(image: str, scale: int = 0) -> Image
```

### triggered

makes triggered meme.

```py
triggered(self, image: str) -> Image
```

### cropcirlce

crops image in circle.

```py
cropcircle(image: str) -> Image
```

### blur

blurs the image using box blur for performance.
`radius` int value for the radius of blur.

```py
blur(image: str, radius: int = 1) -> Image
```

### rotate

rotates the image according to the radius given.
`rotation_angle` int value in angles.

```py
rotate(image: str, rotation_angle: int = 90) -> Image
```

### ascify

makes ascii art from given text.
`str` string text,

```py
asicfy(text: str = 'ascify') -> str
```

### crop

crops image automactically in 1:1 ratio.

```py
crop(image: str) -> Image
```

### resize

resize image according to given width and height.
`width` amd `height` should be atleast 1 and smaller than the original image's width and height.

```py
resize(image: str, width: int = 0, height: int = 0) -> Image
```

### saturate

changes saturation of image.
`scale` int should be between 0 ( being grayscale ) and 10 ( 10 being 10 times more saturated ).

```py
saturate(image: str, scale: int = 0) -> Image
```

### grayscale

grayscales an image.

```py
grayscale(image: str) -> Image
```

### flip

flips image vertically.

```py
flip(image: str) -> Image
```

### mirror

mirrors the image.

```py
mirror(image: str) -> Image
```

### invert

inverts the colors of an image.

```py
invert(image: str) -> Image
```

## What's Next?

I am planing to add a lot more effects to the library, and feel free to contribute to the project with new effects or improvements.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/prashantrahul141/ImageEffects",
    "name": "ImageEffects",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6",
    "maintainer_email": "",
    "keywords": "python,image,manipulation,pillow,PIL",
    "author": "prashantrahul141",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/fb/2b/2e6ba570cebbaf3a8d87367288a2fa05ffb06a5c453e85ab405921696fe4/ImageEffects-0.0.13.tar.gz",
    "platform": "unix",
    "description": "<h1 align='center'>Image Effects</h1>\r\n\r\n<h6 align='center'>A Simple Library to add effects to images written in python using <a target=\"_blank\" href=\"https://pillow.readthedocs.io/en/stable/\">Pillow</a>.</h6>\r\n\r\n<br>\r\n\r\n## Quick Example\r\n\r\n```py\r\n# import the EffectsCreator class\r\nfrom ImageEffects import EffectsCreator\r\n\r\n# initialize it\r\nEC = EffectsCreator()\r\n\r\n# use functions to add effects to images\r\n\r\n# this functions overlays an image with an emoji\r\n# the functions returns a PIL.Image.Image object\r\noutput = EC.emojioverlay('input.png', '\ud83d\udfe5')\r\n\r\n# save the resulted image\r\noutput.save('output.png')\r\n\r\n# or add effects and save them.\r\nEC.caption1('input.png', 'testing text here').save('result_two.jpg')\r\nEC.caption2('input.png', 'testing text here').save('result_three.jpg')\r\nEC.deepfry('input.png').save('result_four.jpg')\r\nEC.pixelate('input.png', 2).save('result_five.jpg')\r\n```\r\n\r\ninput file:\r\n\r\n<img width=\"200px\" src='https://raw.githubusercontent.com/prashantrahul141/ImageEffects/main/ImageEffects/resources/meta/test_image.jpg' alt=\"input\">\r\n<br>\r\n\r\nemojioverlay:\r\n\r\n<img width=\"200px\" src='https://raw.githubusercontent.com/prashantrahul141/ImageEffects/main/ImageEffects/resources/meta/result_one.png' alt=\"emojioverlay\">\r\n<br>\r\n\r\ncaption1:\r\n\r\n<img width=\"200px\" src='https://raw.githubusercontent.com/prashantrahul141/ImageEffects/main/ImageEffects/resources/meta/result_two.jpg' alt=\"caption1\">\r\n<br>\r\n\r\ncaption2:\r\n\r\n<img width=\"200px\" src='https://raw.githubusercontent.com/prashantrahul141/ImageEffects/main/ImageEffects/resources/meta/result_three.jpg' alt=\"caption2\">\r\n<br>\r\n\r\ndeepfry:\r\n\r\n<img width=\"200px\" src='https://raw.githubusercontent.com/prashantrahul141/ImageEffects/main/ImageEffects/resources/meta/result_four.jpg' alt=\"deepfry\">\r\n<br>\r\n\r\npixelate:\r\n\r\n<img width=\"200px\" src='https://raw.githubusercontent.com/prashantrahul141/ImageEffects/main/ImageEffects/resources/meta/result_five.jpg' alt=\"pixelate\">\r\n<br>\r\n\r\n## Index\r\n\r\n- [Installation](#installation)\r\n- [What's Next](#whats-next)\r\n\r\n##### Functions\r\n\r\n- [emojioverlay](#emojioverlay)\r\n- [deepfry](#deepfry)\r\n- [caption1](#caption1)\r\n- [caption2](#caption2)\r\n- [pixelate](#pixelate)\r\n- [triggered](#triggered)\r\n- [cropcircle](#cropcirlce)\r\n- [blur](#blur)\r\n- [rotate](#rotate)\r\n- [ascify](#ascify)\r\n- [crop](#crop)\r\n- [resize](#resize)\r\n- [saturate](#saturate)\r\n- [grayscale](#grayscale)\r\n- [flip](#flip)\r\n- [mirror](#mirror)\r\n- [invert](#invert)\r\n\r\n## More Information\r\n\r\n### Installation\r\n\r\nInstall using pip.\r\n\r\n```sh\r\npip install ImageEffects\r\n```\r\n\r\n## Functions\r\n\r\n### emojioverlay\r\n\r\nOverlays an image with an emoji.\r\n\r\n```py\r\nemojioverlay(image: str, emoji: str, alpha: int = 100) -> Image\r\n```\r\n\r\n### deepfry\r\n\r\nmakes deepfry meme from image.\r\n\r\n```py\r\ndeepfry(image: str) -> Image\r\n```\r\n\r\n### caption1\r\n\r\nadds given text to the image on the top side.\r\n\r\n```py\r\ncaption1(image: str, text: str = 'text here', _font_size_ratio_mul: float = 1.0, _border: bool = False) -> Image\r\n```\r\n\r\n### caption2\r\n\r\nadds given text to the image on the bottom side.\r\n\r\n```py\r\ncaption2(image: str, text: str = 'text here', _font_size_ratio_mul: float = 1.0, _border: bool = False) -> Image\r\n```\r\n\r\n### pixelate\r\n\r\nadds pixelate effect.\r\n`scale` should be between 0 to 6 ( including 0 and 6)\r\n\r\n```py\r\npixelate(image: str, scale: int = 0) -> Image\r\n```\r\n\r\n### triggered\r\n\r\nmakes triggered meme.\r\n\r\n```py\r\ntriggered(self, image: str) -> Image\r\n```\r\n\r\n### cropcirlce\r\n\r\ncrops image in circle.\r\n\r\n```py\r\ncropcircle(image: str) -> Image\r\n```\r\n\r\n### blur\r\n\r\nblurs the image using box blur for performance.\r\n`radius` int value for the radius of blur.\r\n\r\n```py\r\nblur(image: str, radius: int = 1) -> Image\r\n```\r\n\r\n### rotate\r\n\r\nrotates the image according to the radius given.\r\n`rotation_angle` int value in angles.\r\n\r\n```py\r\nrotate(image: str, rotation_angle: int = 90) -> Image\r\n```\r\n\r\n### ascify\r\n\r\nmakes ascii art from given text.\r\n`str` string text,\r\n\r\n```py\r\nasicfy(text: str = 'ascify') -> str\r\n```\r\n\r\n### crop\r\n\r\ncrops image automactically in 1:1 ratio.\r\n\r\n```py\r\ncrop(image: str) -> Image\r\n```\r\n\r\n### resize\r\n\r\nresize image according to given width and height.\r\n`width` amd `height` should be atleast 1 and smaller than the original image's width and height.\r\n\r\n```py\r\nresize(image: str, width: int = 0, height: int = 0) -> Image\r\n```\r\n\r\n### saturate\r\n\r\nchanges saturation of image.\r\n`scale` int should be between 0 ( being grayscale ) and 10 ( 10 being 10 times more saturated ).\r\n\r\n```py\r\nsaturate(image: str, scale: int = 0) -> Image\r\n```\r\n\r\n### grayscale\r\n\r\ngrayscales an image.\r\n\r\n```py\r\ngrayscale(image: str) -> Image\r\n```\r\n\r\n### flip\r\n\r\nflips image vertically.\r\n\r\n```py\r\nflip(image: str) -> Image\r\n```\r\n\r\n### mirror\r\n\r\nmirrors the image.\r\n\r\n```py\r\nmirror(image: str) -> Image\r\n```\r\n\r\n### invert\r\n\r\ninverts the colors of an image.\r\n\r\n```py\r\ninvert(image: str) -> Image\r\n```\r\n\r\n## What's Next?\r\n\r\nI am planing to add a lot more effects to the library, and feel free to contribute to the project with new effects or improvements.\r\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A library to add effects to your images.",
    "version": "0.0.13",
    "split_keywords": [
        "python",
        "image",
        "manipulation",
        "pillow",
        "pil"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0d02f2d8e35155535d3c05ca79f8c701a20057e1e4f805624ee6051110a997e3",
                "md5": "92d991023ffc1f076949916d5ecb3b82",
                "sha256": "55bc8e036925df3b9507383f25dba5a86aafb57d64b167d41dc24f5f60da7e71"
            },
            "downloads": -1,
            "filename": "ImageEffects-0.0.13-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "92d991023ffc1f076949916d5ecb3b82",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6",
            "size": 7760980,
            "upload_time": "2023-01-03T10:02:25",
            "upload_time_iso_8601": "2023-01-03T10:02:25.969006Z",
            "url": "https://files.pythonhosted.org/packages/0d/02/f2d8e35155535d3c05ca79f8c701a20057e1e4f805624ee6051110a997e3/ImageEffects-0.0.13-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fb2b2e6ba570cebbaf3a8d87367288a2fa05ffb06a5c453e85ab405921696fe4",
                "md5": "e40faec711d897ebae711076a4799fba",
                "sha256": "f9deba70db850da45fe929aae3b1220a88676dd817605c1e8003554a4ee985e3"
            },
            "downloads": -1,
            "filename": "ImageEffects-0.0.13.tar.gz",
            "has_sig": false,
            "md5_digest": "e40faec711d897ebae711076a4799fba",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6",
            "size": 6547917,
            "upload_time": "2023-01-03T10:02:29",
            "upload_time_iso_8601": "2023-01-03T10:02:29.575150Z",
            "url": "https://files.pythonhosted.org/packages/fb/2b/2e6ba570cebbaf3a8d87367288a2fa05ffb06a5c453e85ab405921696fe4/ImageEffects-0.0.13.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-03 10:02:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "prashantrahul141",
    "github_project": "ImageEffects",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "Pillow",
            "specs": [
                [
                    ">=",
                    "9.3.0"
                ]
            ]
        },
        {
            "name": "art",
            "specs": [
                [
                    "==",
                    "5.8"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    "==",
                    "1.24.0"
                ]
            ]
        }
    ],
    "lcname": "imageeffects"
}
        
Elapsed time: 0.03397s