Is it possible to remove the whitespace surrounding an image in PHP?
NOTE: to clarify I mean something like photoshops trim feature.
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To trim all whitespace, as you call it, surrounding the interesting part of the image, first we find out where the “whitespace” stops, and then we copy everything inside of those borders.
My old example, that assumes an identical “border” on all sides of the image, just to clarify the comments 🙂