跳转到主要内容

一个简单的图像处理库,旨在使常见的图像任务变得容易。

项目描述

一个简单的图像处理库,旨在使常见的图像/照片处理任务变得容易。此库仍在开发中,API也可能随时更改。

需要PIL/Pillow。

示例用法

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)

如果您需要更广泛的处理,也可以通过PIL进行逃生。

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)

测试

运行测试

python -m unittest tests

变更日志

版本 0.4.0

  • 支持Pillow 10

  • 图像旋转时保留EXIF数据

版本 0.3.0

  • 添加了webp扩展支持

版本 0.2.2

  • 添加了bmp扩展支持

项目详情


下载文件

下载适合您平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

da-vinci-0.4.0.tar.gz (5.4 kB 查看哈希值)

上传时间:

构建分布

da_vinci-0.4.0-py3-none-any.whl (6.1 kB 查看哈希值)

上传时间: Python 3

支持

AWSAWS云计算和安全赞助商DatadogDatadog监控FastlyFastlyCDNGoogleGoogle下载分析MicrosoftMicrosoftPSF赞助商PingdomPingdom监控SentrySentry错误日志StatusPageStatusPage状态页面