用于 python 的超快速和安全的图像处理库。以生锈为动力。
项目描述
宝丽来
超快速图像处理
这是一个进展中的工作。不要在生产中使用。
对于所有示例,都使用 meme.png。请用您使用的任何图像替换它
通过文件系统
from polaroid import Image
im = Image("meme.png")
im.solarize()
im.save("solar.png")
使用字节
# Just an example use any library to supply bytes
from polaroid import Image
import requests
byt = requests.get("https://dagpi.xyz/dagpi.png").content
im = Image(byt)
im.filter("dramatic")
ret_byt = im.save_bytes()
特性
from polaroid import Image
im = Image("meme.png")
h = im.height
w = im.weight
wi,hei = im.size
image_format = im.format
mode = im.mode
使用 RGB 类进行着色
from polaroid import Image, Rgb
im = Image("meme.png")
# Color Rgb
color = Rgb(78, 93, 148)
im.color(color)
# Now Save
方法
图像方法
['add_noise_rand', 'adjust_contrast', 'alter_blue_channel', 'alter_channel', 'alter_channels', 'alter_green_channel', 'alter_red_channel', 'apply_gradient', 'b_grayscale', 'blend', 'box_blur', 'brighten', 'color', 'color_no_grayscale', 'colorize', 'crop', 'decompose_max', 'decompose_min', 'desaturate', 'detect_horizontal_lines', 'detect_vertical_lines', 'edge_detection', 'edge_one', 'emboss', 'filter', 'fliph', 'flipv', 'g_grayscale', 'gaussian_blur', 'gradient', 'grayscale', 'grayscale_human_corrected', 'grayscale_shades', 'hog', 'horizontal_strips', 'identity', 'inc_brightness', 'invert', 'laplace', 'liquid_rescale', 'monochrome', 'noise_reduction', 'offset', 'offset_blue', 'offset_green', 'offset_red', 'oil', 'pink_noise', 'prewitt_horizontal', 'primary', 'r_grayscale', 'remove_blue_channel', 'remove_green_channel', 'remove_red_channel', 'replace_backround', 'resize', 'rotate180', 'rotate270', 'rotate90', 'save', 'save_base_64', 'save_bytes', 'save_jpeg_bytes', 'selective_desaturate', 'selective_hue_rotate', 'selective_lighten', 'selective_saturate', 'sepia', 'sharpen', 'single_channel_grayscale', 'sobel_horizontal', 'sobel_vertical', 'solarize', 'swap_channels', 'threshold', 'thumbnail', 'tint', 'unsharpen', 'vertical_strips', 'watermark']
#All available for Image
RGB 方法
特殊方法Image
from polaroid import Image
im = Image("meme.png")
print(repr(im))
#The `bytes` method is not implemented use
byt = im.save_bytes()
# Save a jpeg
im.save_jpeg(quaility: int)
byt = im.save_jpeg_bytes(quality: int)
项目详情
下载文件
下载适用于您平台的文件。如果您不确定要选择哪个,请了解有关安装包的更多信息。
源分布
宝丽来-0.3.2.tar.gz
(11.1 kB
查看哈希)
内置发行版
宝丽来-0.3.2-cp39-cp39-win_amd64.whl
(980.9 kB
查看哈希)
宝丽来-0.3.2-cp38-cp38-win_amd64.whl
(980.5 kB
查看哈希)
宝丽来-0.3.2-cp37-cp37m-win_amd64.whl
(981.6 kB
查看哈希)
宝丽来-0.3.2-cp36-cp36m-win_amd64.whl
(981.7 kB
查看哈希)