Python Imaging Library保存功能语法 [英] Python Imaging Library save function syntax
问题描述
我认为很简单,但是本质上我需要知道PIL上save函数的语法是什么.帮助真的很模糊,我在网上找不到任何东西.任何帮助都会很棒,谢谢:).
来自 PIL手册附录列出了受支持的不同文件类型.在某些情况下,为save
提供了选项.例如,在 JPEG文件格式页面上,我们被告知保存支持>
-
quality
-
optimize
和 -
progressive
带有有关每个选项的注释.
Simple one I think but essentially I need to know what the syntax is for the save function on the PIL. The help is really vague and I can't find anything online. Any help'd be great, thanks :).
From the PIL Handbook:
im.save(outfile, options...)
im.save(outfile, format, options...)
Simplest case:
im.save('my_image.png')
or whatever. In this case, the type of the image will be determined from the extension. Is there a particular problem you're having? Or specific saving option that you'd like to use but aren't sure how to do so?
You may be able to find additional information in the documentation on each filetype. The PIL Handbox Appendixes list the different file types that are supported. In some cases, options are given for save
. For example, on the JPEG file format page, we're told that save supports
quality
optimize
, andprogressive
with notes about each option.
这篇关于Python Imaging Library保存功能语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!