Skip to main content

Deepfry images in Python.

Project description

deeppyer

banner image

deeppyer is an image deepfryer written in Python using Pillow and OpenCV.

NOTE: This requires at least Python v3.6 in order to run.

How to use

You can either use deeppyer as a module, or straight from the command line.

Command line usage

$ python deeppyer.py -h

usage: deeppyer.py [-h] [-v] [-o OUTPUT] [-f] FILE

Deepfry an image.

positional arguments:
  FILE                  File to deepfry.

optional arguments:
  -h, --help            show this help message and exit
  -v, --version         Display program version.
  -o OUTPUT, --output OUTPUT
                        Filename to output to.
  -f, --flares          Try and detected faces for adding lens flares.

By default, flares will try to be added to the image, unless you're using the CLI script, in which case it is off by default.

Program usage

from PIL import Image
import deeppyer, asyncio

async def main():
    img = Image.open('./foo.jpg')
    img = await deeppyer.deepfry(img)
    img.save('./bar.jpg')

loop = asyncio.get_event_loop()
loop.run_until_complete(main())

API Documentation

async deepfry(img: Image, type=DeepfryTypes.RED, *, flares: bool = True)

Deepfry a given image.

Arguments

  • img (PIL.Image) - Image to apply the deepfry effect on.
  • [type] (DeepfryTypes) - Colours to apply on the image.
  • *[flares] (bool) - Whether or not to try and detect faces for applying lens flares.

Returns: PIL.Image - Deepfried image.

Why?

¯\_(ツ)_/¯ Why not

Contributing

If you wish to contribute something to this, go ahead! Just please make sure to format it with flake8 + isort, and that the test(s) pass fine.

Testing

Simply run tests/test.py and make sure that all the images output properly.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

deeppyer-1.0.1.tar.gz (56.3 kB view details)

Uploaded Source

Built Distribution

deeppyer-1.0.1-py3-none-any.whl (55.3 kB view details)

Uploaded Python 3

File details

Details for the file deeppyer-1.0.1.tar.gz.

File metadata

  • Download URL: deeppyer-1.0.1.tar.gz
  • Upload date:
  • Size: 56.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for deeppyer-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c70721790968eaa5cf1e6bbd2504f4f25e1696346eaa0f81628d41684def14ec
MD5 e4dca11d1d877f8aa2ad8407e693be5c
BLAKE2b-256 865bc8214f60dbbdfad65a3e635c78d6f7b49a996232f69cd10dcd9cdc87a566

See more details on using hashes here.

File details

Details for the file deeppyer-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: deeppyer-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 55.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.7.2

File hashes

Hashes for deeppyer-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 28a0e5b1dd73a8dd9271d3bf023333ca0df8ca38a27079d30c0a2e2c8f0d0758
MD5 e5423d5c3d4934fe49804e404c45dce8
BLAKE2b-256 ed2eb097ca617eae4dbc52032810ea7e5442b1b850f3058283fe4cdd50f93457

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page