Python PIL库之Image注解(API)
http://blog.csdn.net/xiezhiyong3621/article/details/8499543
class Image
Methods defined here:
__getattr__(self, name)
__init__(self)
__repr__(self)
convert(self, mode=None, data=None, dither=None, palette=0, colors=256)
Convert to other pixel format
copy(self)
Copy raster data
复制一个新的对象
crop(self, box=None)
Crop region from image
draft(self, mode, size)
Configure image decoder
filter(self, filter)
Apply environment filter to image
fromstring(self, data, decoder_name='raw', *args)
Load data to image from binary string
从原始图像数据中加载图像,一般用来从剪切板中获取图像
getbands(self)
Get band names
getbbox(self)
Get bounding box of actual data (non-zero pixels) in image
获取当前图像在实际图片中的范围
getcolors(self, maxcolors=256)
Get colors from image, up to given limit
getdata(self, band=None)
Get image data as sequence object.
获取图像数据列表。如果指定band,就获取这个颜色通道的值得列表
1.print im.getdata()[0]
2.(253,23,34)
getextrema(self)
Get min/max value
getim(self)
Get PyCObject pointer to internal image memory
getpalette(self)
Get palette contents.
getpixel(self, xy)
Get pixel value
获取每个坐标像素点的RGB值。参数xy格式为(x,y)
getprojection(self)
Get projection to x and y axes
histogram(self, mask=None, extrema=None)
Take histogram of image
load(self)
Explicitly load pixel data.
offset(self, xoffset, yoffset=None)
(deprecated) Offset image in horizontal and/or vertical direction
paste(self, im, box=None, mask=None)
Paste other image into region
point(self, lut, mode=None)
Map image through lookup table
putalpha(self, alpha)
Set alpha layer
putdata(self, data, scale=1.0, offset=0.0)
Put data from a sequence object into an image.
putpalette(self, data, rawmode='RGB')
Put palette data into an image.
putpixel(self, xy, value)
Set pixel value
设置某坐标像素点值
quantize(self, colors=256, method=0, kmeans=0, palette=None)
resize(self, size, resample=0)
Resize image
重新设置图像大小
rotate(self, angle, resample=0, expand=0)
Rotate image. Angle given as degrees counter-clockwise.
旋转图像
save(self, fp, format=None, **params)
Save image to file or stream
保存图像
seek(self, frame)
Seek to given frame in sequence file
定位到动画某一帧,一般用于gif格式的文件图片
show(self, title=None, command=None)
Display image (for debug purposes only)
现实图像,调用默认的图像浏览器
split(self)
Split image into bands
将图像按照RGB分别解析,返回三个Image对象
tell(self)
Return current frame number
返回当前帧号
thumbnail(self, size, resample=0)
Create thumbnail representation (modifies image in place)
创建缩略图,主要用来修改图像大小和清晰度,以便生产较小的文件
tobitmap(self, name='image')
Return image as an XBM bitmap
tostring(self, encoder_name='raw', *args)
Return image as a binary string
transform(self, size, method, data=None, resample=0, fill=1)
Transform image
transpose(self, method)
Transpose image (flip or rotate in 90 degree steps)
verify(self)
Verify file contents.
--------------------------------------------------------------------------------
Data and other attributes defined here:
format = None
mode
format_description = None
#功能:
blend(im1, im2, alpha)
Interpolate between images.
将两张图片混合到一起。参数alpha是im1与im2的混合权重,范围为[0,1]
Python PIL库之Image注解(API)的更多相关文章
- Python PIL 库的应用
PIL (Python Image Library) 库是Python 语言的一个第三方库,PIL库支持图像存储.显示和处理,能够处理几乎所有格式的图片. 一.PIL库简介 1. PIL库主要有2个方 ...
- python PIL 库处理文件
通过PIL库提供的API接口可以很方便的处理图像,功能十分强大: 最近有一个替换png背景色的需求,替换背景色的同时又不能够覆盖原来的文字,之前利用perl 的CD 模块一直没能够正确处理,最终用PI ...
- Python PIL库学习笔记
1.PIL简介 Python Imaging Library(缩写为PIL)(在新的版本中被称为Pillow)是Python编程语言的开源库,它增加了对打开,操作和保存许多不同图像文件格式的支持.它适 ...
- 使用Python PIL库中的Image.thumbnail函数裁剪图片
今天,是我来到博客园的第五天,发现自己还没有头像,想着上传ubuntu系统中我很喜欢的一个背景图片来当头像,但是因为图片过大,上传失败了.那么,我们如何使用python中强大的PIL库来进行图片裁剪呢 ...
- python PIL库的使用
)PIL可以做很多和图像处理相关的事情: 图像归档(Image Archives).PIL非常适合于图像归档以及图像的批处理任务.你可以使用PIL创建缩略图,转换图像格式,打印图像等等. 图像展示(I ...
- 基于Python PIL实现简单图片格式转化器
基于Python PIL实现简单图片格式转化器 目录 基于Python PIL实现简单图片格式转化器 1.简介 2.前期资料准备 2.1.1如何实现图片格式转换? 2.1.2如何保存需要大小的图片? ...
- Python图像处理库(PIL)
官方:(详细)http://pillow.readthedocs.io/en/3.1.x/reference/ImageDraw.html http://pillow.readthedocs.io/e ...
- ❤️【Python从入门到精通】(二十六)用Python的PIL库(Pillow)处理图像真的得心应手❤️
您好,我是码农飞哥,感谢您阅读本文,欢迎一键三连哦. 本篇重点介绍Python处理图像的标准库PIL库,处理图像真的的很方便. 干货满满,建议收藏,需要用到时常看看. 小伙伴们如有问题及需要,欢迎踊跃 ...
- Python 之 使用 PIL 库做图像处理
http://www.cnblogs.com/way_testlife/archive/2011/04/17/2019013.html Python 之 使用 PIL 库做图像处理 1. 简介. 图像 ...
随机推荐
- dede版权信息修改
login:dede-templets-login.htm 系统主页:dede-templets-index2.htm 主体内容在index_body.htm文件 干掉: $(function() ...
- 正则表达式 自学笔记整理记录 EASY REGEX~
整理正则表达式篇 -wuian7yulian 基础知识介绍 : 1> 字符串的组成: 对于字符串"ABC"来说,其包 ...
- 第二十篇、自定义UIButton(设置title和image的位置)
#import "CustomButton.h" #define ImageW 15 #define ImageH 15 #define KRadio 0.75 @implemen ...
- web前端面试题收集(一)
CSS中margin和padding的区别? Javascript中如何检测一个变量是一个String类型?请写出函数实现. 网页中实现一个计算当年还剩多少时间的倒计时程序,要求网页上实时动态显示“x ...
- Java大数操作类
Java的大数操作分为BigInteger和BigDecimal,但这两给类是分开使用的,有时候在编程的时候显得略微繁琐,现在编写了一个将二者合二为一的大数操作类. 大数操作类代码如下: packag ...
- HDOJ 1024 Max Sum Plus Plus -- 动态规划
题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1024 Problem Description Now I think you have got an ...
- C#语法需要注意的地方
笔试中遇到的一些C#语法方面的问题,由于平时很少用到,笔试的时候模棱两可,现在做一个笔记. using System; using System.Collections.Generic; using ...
- hdu 5055 Bob and math problem
先把各个数字又大到小排列,如果没有前导零并且为奇数,则直接输出.如果有前导零,则输出-1.此外,如果尾数为偶数,则从后向前找到第一个奇数,并把其后面的数一次向前移动,并把该奇数放到尾部. 值得注意的是 ...
- 用Objective-C的foundation框架解决表达式求值问题
主要思想: 本程序分2个类 一个是ExpressionString类,主要用于存储表达式以及对它进行求值.以下是该类中的内容: (NSString *)expString//用于存储要计算的表达式: ...
- Unix/Linux之命令备忘录
ps:是显示瞬间进程的状态,并不动态连续 kill:用于杀死进程或者给进程发送信号 // 在Linux下查看所有java进程命令 ps -ef | grep java: // 停止所有java进程命 ...