Skip to main content

A simple image manipulation library aiming to make common image tasks easy.

Project description

A simple image manipulation library aiming to make common image/photo manipulation tasks easy. This library is still under development, API may also change at any time.

Requires PIL/Pillow.

Example usage:

from da_vinci import Image

image = Image('lena.jpg')
image.flip('horizontal')
image.resize(width=10, height=10)
image.save()

# Opening an image from URL, rotating and change it's format
image = Image('http://stamps.co.id/static/merchants/img/logo.png')
image.rotate(degrees=90)
image.set(format='jpg', quality=85)
image.save() # Creates a file logo.jpg

# Manipulating saturation, brightness, contrast and sharpness
# Accepts values range from -100 (decrease) to 100 (increase)
image.adjust(saturation=-100)
image.adjust(brightness=-75, contrast=50, sharpness=-20)

If you need more extensive manipulation, an escape hatch to PIL is also available:

image = image.from_file('a.jpg')
pil_image = image.get_pil_image()
# Do whatever you need to do with the pil image
# And if you want to convert this back to a da_vinci image
image.set_pil_image(pil_image)

Tests

To run tests:

python -m unittest tests

Changelog

Version 0.3.0

  • Added webp extension support

Version 0.2.2

  • Added bmp extension support

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

da-vinci-0.3.0.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

da_vinci-0.3.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file da-vinci-0.3.0.tar.gz.

File metadata

  • Download URL: da-vinci-0.3.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for da-vinci-0.3.0.tar.gz
Algorithm Hash digest
SHA256 294f2aed5b41fe92d313b575f8221d2c457ed8007ef84b5960f5f74b45cdba8c
MD5 347a275e6ca3a415d616b8e4fbcd8f88
BLAKE2b-256 0fa89b7a5dcae96ccf63539c4f5cca86e83dda46fcdec0b01815aa0e41819a9b

See more details on using hashes here.

File details

Details for the file da_vinci-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: da_vinci-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.6.5

File hashes

Hashes for da_vinci-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 aded66359f49a39ea4d62986988072a2e97ef09d0a27a55369f7ebc40d088e46
MD5 725f1e52f8a21cd7cc07ad467839d909
BLAKE2b-256 e079344ae0265ba421d3d7ffe531e4357d78e1884ddb89f9fb63f3a176b0ac21

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