渐变国旗头像制作教程及工具!
如果信念有颜色,那么一定就是中国红!这款头像真的是超燃!而且非常好看,有木有!大家抓紧给自己安排上吧!
十一就快来了,大家换个喜庆的头像庆祝祖国诞辰蛮好的!献上祝福,好好学习,努力工作,认真生活,让我们一起为祖国的明天而努力。
大家抓紧时间按照方法去给自己设置渐变头像吧!
Python代码方法:
from PIL import Image
# 读取图片
guoqi = Image.open('五星红旗.png')#可以保存以下五星红旗图片
touxiang = Image.open('头像.jpg')#选择自己需要变化的图片
# 获取国旗的尺寸
x,y = guoqi.size
# 根据需求,设置左上角坐标和右下角坐标(截取的是正方形)
quyu = guoqi.crop((262,100, y+62,y-100))
# 获取头像的尺寸
w,h = touxiang.size
# 将区域尺寸重置为头像的尺寸
quyu = quyu.resize((w,h))
# 透明渐变设置
for i in range(w):
for j in range(h):
color = quyu.getpixel((i, j))
alpha = 255-i//3
if alpha < 0:
alpha=0
color = color[:-1] + (alpha, )
quyu.putpixel((i, j), color)
# 粘贴到头像并保存
touxiang.paste(quyu,(0,0),quyu)
touxiang.save('五星红旗半透明渐变头像.png')
在线网址方法:
渐变国旗头像:https://www.xsbbs.org/tool/jbgqtx/?v=1.1
微信国庆头像:https://www.xsbbs.org/tool/guoqing/?v=1.2
本文内容来源网络。以上内容仅供学习使用,不作其它用途,如有侵权,请留言联系,作删除处理!
有任何疑问及建议,扫描以下公众号二维码添加交流:
关键词
图片
方法
坐标
Image.open
内容
最新评论
推荐文章
作者最新文章
你可能感兴趣的文章
Copyright Disclaimer: The copyright of contents (including texts, images, videos and audios) posted above belong to the User who shared or the third-party website which the User shared from. If you found your copyright have been infringed, please send a DMCA takedown notice to [email protected]. For more detail of the source, please click on the button "Read Original Post" below. For other communications, please send to [email protected].
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。
版权声明:以上内容为用户推荐收藏至CareerEngine平台,其内容(含文字、图片、视频、音频等)及知识版权均属用户或用户转发自的第三方网站,如涉嫌侵权,请通知[email protected]进行信息删除。如需查看信息来源,请点击“查看原文”。如需洽谈其它事宜,请联系[email protected]。