Skip to main content

A easy class for save the data by the img

Project description

ImData

Author: Jeef
Email: jeefy163@163.com


Installation

Use git to clone it for the github.com.
See Github
Or see PyPI to install
pip install imdata.


Usage

the main class is ImData.
Dependeces: imageio
Advice: Use python that later than 3.5, no support for 2.7

Imdata.bytes_pix(bs, size, encode='utf-8')

if bs is a string, use 'encode' to encode the string.
size is the size of the img, such as (40, 80).
size is not for the length of the bs, it's about 1.4 bigger than the length.
for eample, if bytes is like b'my bytes', size at least should be (3,4) instead of (2,4)

ImData.pix_bytes(pix, encode='utf-8')

The pix is the np.array object. Use import numpy as np; pix = np.array(...).
encode for the bytes type, is want a string.

ImData.read(uri)

Read from the image, notice that do not read a unsupport picture.

ImData.save(uri, bytes=None, size, format)

Save the bytes to the image.
format can only be in 'tif', 'tiff', 'png' but not for 'jpg', 'jpeg', 'gif' and so on.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for imdata, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size imdata-0.0.2-py3-none-any.whl (4.5 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size imdata-0.0.2.tar.gz (4.1 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page