Nastary
Nastary

Reputation: 345

How Remove transparent area from png file?

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

enter image description here enter image description here

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

is it possible?

Upvotes: 0

Views: 2901

Answers (2)

Nastary
Nastary

Reputation: 345

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/

all we need use -trim like:

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

enter image description here

As you see.

Upvotes: 1

Mark Setchell
Mark Setchell

Reputation: 207465

I think I have the solution:

convert NyRQK.png -background red -alpha remove out.png

Of course, you can change red to white or any other colour you like.

enter image description here

Upvotes: 0

Related Questions