如何从png文件中删除透明区域? [英] How Remove transparent area from png file?

查看:960
本文介绍了如何从png文件中删除透明区域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从输入文本表单中获取文本并创建PNG文件,如:

I get text from input text form and create PNG file like:


如果查看示例png文件,找到那些有透明区域的文件。
我的目标是使用imagemagick或php GD删除它。

if you look at the example png file, find those have some transparent area. my goal is remove that with imagemagick or php GD.

是否可能?

推荐答案

感谢Mark为您提供解决方案和帮助,但感谢您提供的最佳解决方案

Thank you Mark for your solution and your help, but the best solution by thank a lot from

Joakim Carlsten
http://www.adtradeconsulting.se/remove-transparency-around-image-with -imagemagick /

我们需要使用-trim如下:

all we need use -trim like:

exec('convert source.png -trim result.png')

如您所见。

这篇关于如何从png文件中删除透明区域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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