laziness, impatience, and hubris | |
PerlMonks |
Re: Detect boundaries within .png's - and croppingby Tux (Canon) |
on Jul 08, 2020 at 09:25 UTC ( [id://11119031]=note: print w/replies, xml ) | Need Help?? |
The other two answers are good (and way better than my approach), but I'd share my thoughts anyway. As .xpm data is extremely easy to analyse, I'd do
Where Black should be replaced with a color not in the image. Then analyze the .xpm and use that to crop the image. To be completely dynamic, you can repeat the process for Black, White, and Red and take the minimum margins of the three analises. Enjoy, Have FUN! H.Merijn
In Section
Seekers of Perl Wisdom
|
|