I want to mimic the trim behavior of Photoshop (crop the area that is covered by the same color on all sides) with GD and PHP but I'm lacking ideas on how to accomplish this.
If someone has any idea on how to do this I would very much like to hear it.
Thanks in advance.
The easiest solution I can think of is:
Untested but might work.
BTW, ImageMagick can do this out of the box: http://www.imagemagick.org/Usage/crop/#trim
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With