RGBA在Python中的合并处理

RGB三色模型一般都懂,合并时无非就是覆盖,最近搞一个头像时涉及到透明背景,透明确实更适合合并多层图来达到想要的效果。而支持透明的rgba模型就是增加了透明的alpha属性。在合并时PIL中的image对象有一个split函数可以分离rgba三个通道,将alpha作为mask参数传入past函数就可以正确合并透明的图像了。

作者

Carry

发布于

2016-09-06

更新于

2026-05-23

许可协议

You need to set install_url to use ShareThis. Please set it in _config.yml.
You forgot to set the business or currency_code for Paypal. Please set it in _config.yml.

评论

You forgot to set the shortname for Disqus. Please set it in _config.yml.
You need to set client_id and slot_id to show this AD unit. Please set it in _config.yml.