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

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.2.1.tar.gz (5.0 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: da-vinci-0.2.1.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for da-vinci-0.2.1.tar.gz
Algorithm Hash digest
SHA256 bba5428703233bf9c9876c50a5701d5b0c83bbe104217126b45b0d6a037e8805
MD5 4e5a96ec975f11574694c03ca1c15e10
BLAKE2b-256 b3dc52f98ff61d154ebcda08431143d8d81a2c7eec424cd396c4a8b577f48fbf

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