Skip to main content

Hyper Fast and safe image manipulation library for python. Powered by rust.

Project description

Polaroid

Deployment Actions License Wheel Python Version Rust Report Chat Codacy Badge

Hyper fast image processing

This is a Work in Progress. DO NOT USE in production.

For all the examples, meme.png is used. Please replace that with whatever Image you use

Via File System

from polaroid import Image
im = Image("meme.png")
im.solarize()
im.save("solar.png")

Using Bytes

# 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()

Properties

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

Using the RGB class for coloring

from polaroid import Image, Rgb
im = Image("meme.png")
# Color Rgb 
color = Rgb(78, 93, 148)
im.color(color)

# Now Save

Methods

Image Methods

['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 Methods


Special Methods for 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)

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

polaroid-0.3.2.tar.gz (11.1 kB view hashes)

Uploaded Source

Built Distributions

polaroid-0.3.2-cp39-cp39-win_amd64.whl (980.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

polaroid-0.3.2-cp39-cp39-manylinux2014_aarch64.whl (1.8 MB view hashes)

Uploaded CPython 3.9

polaroid-0.3.2-cp39-cp39-manylinux2010_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

polaroid-0.3.2-cp39-cp39-manylinux2010_i686.whl (2.1 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

polaroid-0.3.2-cp39-cp39-manylinux1_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.9

polaroid-0.3.2-cp39-cp39-manylinux1_i686.whl (2.1 MB view hashes)

Uploaded CPython 3.9

polaroid-0.3.2-cp39-cp39-macosx_11_0_arm64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ ARM64

polaroid-0.3.2-cp39-cp39-macosx_10_9_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

polaroid-0.3.2-cp38-cp38-win_amd64.whl (980.5 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

polaroid-0.3.2-cp38-cp38-manylinux2014_aarch64.whl (1.8 MB view hashes)

Uploaded CPython 3.8

polaroid-0.3.2-cp38-cp38-manylinux2010_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

polaroid-0.3.2-cp38-cp38-manylinux2010_i686.whl (2.1 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

polaroid-0.3.2-cp38-cp38-manylinux1_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.8

polaroid-0.3.2-cp38-cp38-manylinux1_i686.whl (2.1 MB view hashes)

Uploaded CPython 3.8

polaroid-0.3.2-cp38-cp38-macosx_10_9_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

polaroid-0.3.2-cp37-cp37m-win_amd64.whl (981.6 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

polaroid-0.3.2-cp37-cp37m-manylinux2014_aarch64.whl (1.8 MB view hashes)

Uploaded CPython 3.7m

polaroid-0.3.2-cp37-cp37m-manylinux2010_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

polaroid-0.3.2-cp37-cp37m-manylinux2010_i686.whl (2.1 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

polaroid-0.3.2-cp37-cp37m-manylinux1_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.7m

polaroid-0.3.2-cp37-cp37m-manylinux1_i686.whl (2.1 MB view hashes)

Uploaded CPython 3.7m

polaroid-0.3.2-cp37-cp37m-macosx_10_9_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

polaroid-0.3.2-cp36-cp36m-win_amd64.whl (981.7 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

polaroid-0.3.2-cp36-cp36m-manylinux2014_aarch64.whl (1.8 MB view hashes)

Uploaded CPython 3.6m

polaroid-0.3.2-cp36-cp36m-manylinux2010_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

polaroid-0.3.2-cp36-cp36m-manylinux2010_i686.whl (2.1 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

polaroid-0.3.2-cp36-cp36m-manylinux1_x86_64.whl (1.9 MB view hashes)

Uploaded CPython 3.6m

polaroid-0.3.2-cp36-cp36m-manylinux1_i686.whl (2.1 MB view hashes)

Uploaded CPython 3.6m

polaroid-0.3.2-cp36-cp36m-macosx_10_9_x86_64.whl (1.1 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

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