Skip to main content

The library that translates the Pillow expression into a Numpy array and on the contrary. It also allows you to save images from the Numpy array.

Project description

ArrayPil


The library that translates the Pillow image into a Numpy array and on the contrary. It also allows you to save images from the Numpy array. The library is designed to facilitate and understand the code. I also apologize for my crooked English translation. Author's website: https://tatem.pythonanywhere.com/

Example of using the library:

importing ArrayPil

from ArrayPil import ArrayPil

importing numpy and pillow

from PIL import Image
import numpy as np

put the ArrayPil class in a variable

ArrayPil = ArrayPil()

we will get a array numpy the image that we took from our folder (your folder)

# the first parameter is the location of the image 
# the second parameter is the default RGB color model
num_array = ArrayPil.ConvImgArray('image1.jpg')
print(num_array)

convert the a array numpy into a picture

# the first parameter is a array numpy
# the second parameter is the location where the image is saved
# the third parameter is the default RGB color model
ArrayPil.ImgSave(num_array, 'res.jpg')

convert the numpy array to a pillow image

# the first parameter is a array numpy
# the second parameter is the default RGB color model
pil_img = ArrayPil.ConvImgPil(num_array)
print(pil_img)

convert pillow images to numpy array

# the first parameter is the pillow image
# the second parameter is the default RGB color model
num_array2 = ArrayPil.ConvPilArray(pil_img)
print(num_array2)

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

ArrayPil-1.1.tar.gz (2.8 kB view hashes)

Uploaded Source

Built Distribution

ArrayPil-1.1-py3-none-any.whl (3.1 kB view hashes)

Uploaded Python 3

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