是否可以使用PIL降低图像的深度? [英] Is it possible to reduce an image's depth using PIL?

查看:212
本文介绍了是否可以使用PIL降低图像的深度?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用PIL减少图像的深度?比如从常规的8bpp转到4bpp。

Is it possible to reduce the depth of an image using PIL? Say like going to 4bpp from a regular 8bpp.

推荐答案

您可以轻松转换图像模式(只需调用图像对象 im 上的im.convert(newmode),它会为你提供新所需模式的新图像),但是没有模式为4bpp;支持的模式在此处列出。 / imagingbook /rel =nofollow noreferrer> Python成像库手册

You can easily convert image modes (just call im.convert(newmode) on an image object im, it will give you a new image of the new required mode), but there's no mode for "4bpp"; the modes supported are listed here in the The Python Imaging Library Handbook.

这篇关于是否可以使用PIL降低图像的深度?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆