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.4.0

  • Support Pillow 10

  • Preserve EXIF data when image is rotated

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

Uploaded Source

Built Distribution

da_vinci-0.4.0-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: da-vinci-0.4.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.28.1 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.3

File hashes

Hashes for da-vinci-0.4.0.tar.gz
Algorithm Hash digest
SHA256 130bc0dd7ff69294917eec867ef0d55a19d6006afa63b2b9101570153372dd33
MD5 634be24137ea16a797b9b5d08efdde37
BLAKE2b-256 86e710168a7e22e060d7ed008cb0529669e13817c9b2401c5177d558fd436e37

See more details on using hashes here.

File details

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

File metadata

  • Download URL: da_vinci-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.28.1 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.3

File hashes

Hashes for da_vinci-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2039c67fa8e2338f8457362a0a8d672a4e19c970a41a86fc87240f6702ead762
MD5 df011288ffc3040ed5cc576bd158ca02
BLAKE2b-256 ff1db92a04402f765efd96d024a5077b32f429f3c34271d4fbcf48d65ea543b7

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