中级玩家
![Rank: 3](static/image/common/star_level2.gif) ![Rank: 3](static/image/common/star_level1.gif)
- 贡献度
- 0
- 金元
- 995
- 积分
- 100
- 精华
- 0
- 注册时间
- 2016-3-5
|
本帖最后由 nathanbk 于 2020-2-24 23:00 编辑
赞一个~ 然后通过楼主的启发,我用python编程也实现了这个效果:
import png
text=b'Comment\x00[type:angry;x:0;y:50;z-order:0;pivot_x:0.5000;pivot_y:0.5000;][type:happy;x:0;y:50;z-order:0;pivot_x:0.5000;pivot_y:0.5000;][type:norm;x:0;y:50;z-order:0;pivot_x:0.5000;pivot_y:0.5000;]'
reader = png.Reader(filename=原图路径)
chunk_list = list(reader.chunks())
chunk_item = tuple([b'tEXt', text])
chunk_list.insert(1, chunk_item)
with open(新图路径, 'wb') as dst_file:
png.write_chunks(dst_file, chunk_list)
多说一句,也可以用代码自动抠图:
from removebg import RemoveBg
rmbg = RemoveBg(官网注册的Key, "error.log")
rmbg.remove_background_from_img_file(要扣的图的路径)
现在裁剪图片、生成目录、甚至人脸识别都可以做到, 但是如何合理定位位置还是个问题。。
|
|