I have a PNG image, which has a transparent background.
I'm using PHP GD to display these images, from a server. Is it possible in GD to also trim this transparent background, while maintaining the remainder of the image to be transparent and if so, how would I do it?
eg. original image: http://puu.sh/8pNdx/ab2ff1e64f.png
and the expected result after processing would be: http://puu.sh/8pNg7/7b7ec85459.png
If it is really important to remove transparent pixels than you will have to write a small custom algorithm.
Try searching for some efficient algorithm for:
separating objects from an image
I hope it will help.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.