六、PYTHON 库文件---PIL库

目录

1.常用引入方式

2.处理图片时的常用属性

3.剪切、合并图像函数

4.读取、创建图像函数

5.图形绘制函数

6.获取数据函数

7.序列操作函数

8.转换,保存图像函数

9.像素点,通道处理函数

10.增强、滤镜函数

11.几何变换函数


1.常用引入方式

>>> from PIL import Image

2.处理图片时的常用属性

PIL.Image.format
PIL.Image.mode
PIL.Image.palette 
PIL.Image.size

3.剪切、合并图像函数

Image.cpoy()
Image.crop (box)
Image.paste (im, box , mask)
Image.merge ("RGB", (b, g, r)

4.读取、创建图像函数

Image.open('ilename jpg')
Image.new(mode, size,color)
Image.open (StringIo.StringIO(buffer))
TarIO.TarIO("Im.tar","Im.ppm")
Image.fromarray(obj, mode)
Image.frombytes(mode, size, data)
Image.frombuffer (mode, size, data)
Image. verify()

5.图形绘制函数

ImageDraw. Draw.line (ixy, fill, width)
ImageDraw. Draw.arc(xy, start, end,fil1)
ImageDraw. Draw.chord(xy, start, end,fill, outline)
ImageDraw. Draw.bitmap (xy,bitmap, fi1l)
ImageDraw. Draw.ellipse(xy,fill, outline)
ImageDraw. Draw.point (xy,fil1)
ImageDraw. Draw.polygon (xy,fill, outline)
ImageDraw. Draw.rectangle(xy,fill, outline)
ImageDraw. Draw.text (xy,text, fill, font, anchor)
ImageDraw. Draw.textsize(text, font)

6.获取数据函数

Image.getdata ()
Image.getbands ()
Image. getpixel(xy)
Image.getcolors(max=256)
Image.getextrema()
Image.getbox ()
Image.histogram (mask)

7.序列操作函数

Image.seek (frame)
Image.tell()

8.转换,保存图像函数

Image.save( (title, command)')
Image.show (title, command)
Image. convert (mode, matrix, colors=256)
Image.thumbnail (size, resample=1)
Image. draft ()

9.像素点,通道处理函数

Image.point (lut, mode=None)
Image.eval (im,*args) Image. load()
Image.split()
Image.merge ()
Image.blend (im1,im2, alpha)
Image.composite(im1,im2, mask)
Image.alpha composite(im1,im2)

10.增强、滤镜函数

Image.filter (ImageFilter.fuction)
ImageEnhance.enhance (Factor)
ImageEnhance.color(im)
ImageEnhance.Contrast (im)
ImageEnhance.Brightness (im)
ImageEnhance.Sharpness (im)

11.几何变换函数

Image.resize(size)
Image.rotate(angle,resample=0,expand=0)
Image.transpose(method)
Image.transform(size,method, data, resample, fill)

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

我Bu秃头

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值