Welcome to Qi-U Community for programmer and developer-Open, Learning and Share

Categories

0 votes
202 views
in Technique[技术] by (31.9m points)

有关图片格式jpg转换成png格式

由于商品列表的商品图片都是jpg白底的,而界面风格是深色的,导致很有违和感。然后就想到前端能不能独立完成将图片格式jpg转换成png呢?
抱着该疑问,使用了Canvas将白色背景的jpg转成透明背景的png,参考网址为https://ostack.cn/a/1190000003718702
一两张还好,多张就不太行了,有没有好的解决方案或者其它方法呢


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

1 Answer

0 votes
by (31.9m points)

纯前端的话只有 Canvas 抠图一种方法,以牺牲性能为代价。

问题是这种需求为毛要纯前端自己处理啊?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Qi-U Community for programmer and developer-Open, Learning and Share
...