Skip to main content

library for instagram filters

Project description

pilgram

PyPI PyPI - Python Version Python CI codecov

A python library for instagram filters.

screenshot

The filter implementations are inspired by CSSgram.

Requirements

Install

pip install pillow>=4.1.0 # or pip install pillow-simd
pip install pilgram

Usage

Available instagram filters on pilgram:

  • _1977
  • aden
  • brannan
  • brooklyn
  • clarendon
  • earlybird
  • gingham
  • hudson
  • inkwell
  • kelvin
  • lark
  • lofi
  • maven
  • mayfair
  • moon
  • nashville
  • perpetua
  • reyes
  • rise
  • slumber
  • stinson
  • toaster
  • valencia
  • walden
  • willow
  • xpro2
from PIL import Image
import pilgram

im = Image.open('sample.jpg')
pilgram.aden(im).save('sample-aden.jpg')

Similarly, pilgram provides css filters and blend modes as a by-product.

Available css filters on pilgram.css:

  • contrast
  • grayscale
  • hue_rotate
  • saturate
  • sepia
from PIL import Image
import pilgram.css

im = Image.open('sample.jpg')
pilgram.css.sepia(im).save('sample-sepia.jpg')

Available blend modes on pilgram.css.blending:

  • color
  • color_burn
  • color_dodge
  • darken
  • difference
  • exclusion
  • hard_light
  • hue
  • lighten
  • multiply
  • normal
  • overlay
  • screen
  • soft_light
from PIL import Image
import pilgram.css.blending

backdrop = Image.open('backdrop.jpg')
source = Image.open('source.jpg')
pilgram.css.blending.color(backdrop, source).save('blending.jpg')

Demo

Open In Colab

Filter performance comparison with instagram-filters

Open In Colab

filter performance comparison

Test

pipenv install --dev
make test     # pytest
make test-tox # pytest with tox

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

pilgram-1.2.0.tar.gz (766.1 kB view details)

Uploaded Source

Built Distribution

pilgram-1.2.0-py3-none-any.whl (804.6 kB view details)

Uploaded Python 3

File details

Details for the file pilgram-1.2.0.tar.gz.

File metadata

  • Download URL: pilgram-1.2.0.tar.gz
  • Upload date:
  • Size: 766.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for pilgram-1.2.0.tar.gz
Algorithm Hash digest
SHA256 4994c33bab7592a176cc904d02959bf53104ef6ef872e8268dddeb89f136ea13
MD5 3cf8ea5a825746b7d3c0454a9503dab7
BLAKE2b-256 aaf11d72001203e2e502496b82a44c220b9ce74c1728d046319e0ee2ef53b2c0

See more details on using hashes here.

File details

Details for the file pilgram-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: pilgram-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 804.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.0

File hashes

Hashes for pilgram-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 65f66b03b1064d3edcbf0d4eaf66efe38b9ca681dc7dd6980ab8733b2e878a3d
MD5 e958cf200a9450d141c452d6f51ec167
BLAKE2b-256 0fc2478f2901990c78d5d9cffebc852fce13c6ca4e18b5023a2085d4ebc1e710

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