1.4.2
Deno wrapper for Python Pillow
Repository
Current version released
5 years ago
Dependencies
std
Python Pillow for Deno
Image processing capabilities, resize, rotate, watermarks & filters.
Install
Download and install Python https://www.python.org/downloads/. Next, install argparse and pillow
Windows:
pip install argparse pillowLinux or Mac:
pip3 install argparse pillowExample
import { pillow } from 'https://deno.land/x/python_pillow/mod.js'
const image = './example.jpg'
await pillow.resize(image, 400)
await pillow.rotate(image, 180)
// deno run --allow-read --allow-write --allow-net --allow-run=python3.9 --watch --unstable example.jsResize
await pillow.resize(image, 200) // image, width pxRotate
await pillow.rotate(image, 200) // image, degThumbnail
await pillow.thumbnail(image, 200) // image, widthMerge
const merge = {
img: 'second_image.jpg',
x: 100,
y: 100
}
await pillow.merge(image, merge) // image, configsWatermark
const watermark = {
font: 'lato.ttf',
color: '#ffffff',
size: 200,
x: 100,
y: 100,
text: 'hello world!'
}
await pillow.watermark(image, watermark) // image, configsHorizontal flip
await pillow.horizontalFlip(image) Vertical flip
await pillow.verticalFlip(image) Blur
await pillow.blur(image) Contour
await pillow.contour(image) Detail
await pillow.detail(image) Edges
await pillow.edges(image) Edge enhance
await pillow.edge_enhance(image) Edge enhance x3
await pillow.edge_enhance_more(image) Emboss
await pillow.emboss(image) Sharpen
await pillow.sharpen(image) Smooth
await pillow.smooth(image) Smooth more
await pillow.smooth_more(image) Grayscale
await pillow.grayscale(image)