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.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java应用程序不是在Eclipse中运行,而是在命令行中运行   swing Java图形组件问题。似乎找不到错误   我需要键盘。close();让代码正常工作?   Springboot中的java HttpSession   抽象语法树我想添加一个语句。我试图解析它,java解析器异常被抛出。如何克服它?   java Hibernate:清理会话   具有不连续子集的java划分问题   java正则表达式查找最后一个冒号后的字符串   java从SpringShell执行OS命令   Java扫描器字符串输入   java字符串索引越界异常(charAt)   java执行器服务终止被卡住   Springockito没有继承java@ContextConfiguration   java如何为一个servlet映射多个url   java安卓获取命令的stderr   java生成类型。表:数据库中的大数字   安卓 Getter Setter返回NothingJava