codecamp

Pillow GifImagePlugin模块

​classPIL.GifImagePlugin.GifImageFile(fp=None, filename=None)​

基类:PIL.ImageFile.ImageFile

​data()​
​format= 'GIF'​
​format_description= 'Compuserve GIF'​
​global_palette= None​
​propertyis_animated​
​load_end()​
​propertyn_frames​
​seek(frame)​

查找此序列文件中的给定帧。如果在序列结尾之外查找,该方法将引发 EOFError 例外。打开序列文件时,库自动查找第0帧。

见 tell() 。

参数

frame -- 帧编号,从0开始。

引发

EOFError -- 如果调用试图在序列结束后查找。

​tell()​

返回当前帧号。见 seek() .

返回

帧编号,从0开始。

​PIL.GifImagePlugin.get_interlace(im)​
​PIL.GifImagePlugin.getdata(im, offset=0, 0, **params)​

遗留方法

返回表示此图像的字符串列表。第一个字符串是本地图像头,其余字符串包含编码的图像数据。

参数
  • im -- 图像对象

  • offset -- (x,y)像素的元组。默认为(0,0)

  • **params -- 例如,持续时间或其他编码器信息参数

返回

包含GIF编码帧数据的字节列表

​PIL.GifImagePlugin.getheader(im, palette=None, info=None)​

从图像中获取GIF数据的传统方法。

警告::可能会修改图像数据。

参数
  • im -- 图像对象

  • palette -- 包含源调色板的bytes对象,或….

  • info -- 编码信息

返回

(标题项列表,优化调色板)的元组


Pillow GbrImagePlugin 模块
Pillow GribStubImagePlugin模块
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

Pillow 参考

Pillow ImageChops模块

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }