img保存数据的简易类
imdata的Python项目详细描述
信息数据
Author:Jeef
电子邮件:jeefy163@163.com
安装
使用git为github.com网站.
请参见Github
或参阅PyPI安装pip install imdata
。在
使用
主类是ImData。
依赖项:imageio
Advice:使用高于3.5的python,不支持2.7
在Imdata.bytes\u像素(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_字节(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,字节=无,大小,格式)
Save the bytes to the image.
format can only be in 'tif', 'tiff', 'png' but not for 'jpg', 'jpeg', 'gif' and so on.
- 项目
标签: