Skip to main content

apply the animated rainbow effect to images

Project description

pyrainboweffect

中文指南

Documentación en español

Documentation en français

Introduction

Take an image like this:

Loading...

And transform it to this:

Loading...

Quick Start

  • Install the package:
pip install pyrainboweffect

Python API

In a Python console, import the package:

>>> import pyrainboweffect

Apply the effect to an image file and save the result as a gif:

>>> pyrainboweffect.psychedelic_gif('input.png', 'output.gif')

Apply the effect to an image file and save the result as an mp4:

>>> pyrainboweffect.psychedelic_mp4('input.png', 'output.gif')

CLI

To use the CLI:

$ python -m pyrainboweffect input.png output.gif

API Documentation

For the complete API documentation, click here.

Theory of Operation

This effect can be generated as follows:

  1. Convert the image to greyscale.
  2. Partition the intensity space into the same number of partitions as colors in the color scheme.
  3. Set the intensity regions to their corresponding colors
  4. Increase the intensity of all pixels in the original image (restarting at 0 intensity if overflow occurs).
  5. Go to step 2 and repeat until there are enough sequential frames to make an animation.

Dependencies

Only Python version 3.6 and greater are supported. This package should run on any POSIX system as well as Windows 7 and greater.

The following Pypi packages are required:

  • moviepy
  • numpy
  • opencv-python

Contributing

Suggestions and pull requests are welcome. If you find a bug and don't have time to fix it yourself, feel free to open an issue.

Future Tasks

  • TODO: Apply the psychedelic effect to an animated image or video.

Download files

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

Source Distribution

pyrainboweffect-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

File details

Details for the file pyrainboweffect-0.1.0.tar.gz.

File metadata

  • Download URL: pyrainboweffect-0.1.0.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.8

File hashes

Hashes for pyrainboweffect-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6b2844a6cd4a3512522e398c106a9f415789fb76b7b3cdd49fe0e192605236a5
MD5 8855df0760c9e98500f695a5928af700
BLAKE2b-256 be24950b915af9695127606fe7f1f35dc34ae028761a57241890814fed817f87

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