【问题标题】:Manipulate WebP images in Python在 Python 中处理 WebP 图像
【发布时间】:2011-10-16 03:09:28
【问题描述】:

我正在寻找类似 PIL(Python Imaging Library)的东西,遗憾的是它不支持 WebP 图像。

我希望能够调整大小和裁剪。或者至少转换为 JPEG,然后我可以使用 PIL。

【问题讨论】:

  • PIL开发版支持WebP(bitbucket.org/effbot/pil-2009-raclette)
  • 酷,谢谢。我找了,没找到路线图,不知道有没有?
  • 对于 PIL,您需要来自 bitbucket、libwebp0 和 libwebp-dev 的最新 (2011-06-28) 代码。我在使用 libwebp2(ubuntu ppa 包)时遇到了问题。

标签: python image-processing image-manipulation python-imaging-library webp


【解决方案1】:

看看: http://code.google.com/p/python-webm/

我能够浏览测试文件,看看他们是怎么做的。

【讨论】:

【解决方案2】:

imagemagick's convert tool,版本 6.5.7-8 或更高版本,can manipulate WebP images

此外,Google 还为 Linux、Windows 和 Mac OS X 提供了encoder and decoder

【讨论】:

  • 感谢 unutbu 的提示。在这种特定情况下,我将图片保存在内存中,并且不希望将它们具体化为文件以调用 imagemagick 的工具。如果我用 C++ 编码,我也许可以直接挂接到 imagemagick 的代码中。解码器至少提供了一个API,仍然是C++,但最后我可以尝试包装它。
  • 其实6.6.8-5版本是第一个支持WebP图片的(imagemagick.org/script/changelog.php)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2010-09-10
  • 1970-01-01
  • 2017-09-10
  • 2014-06-24
  • 2016-04-11
  • 1970-01-01
  • 2012-01-09
相关资源
最近更新 更多