I'm trying to remove transparent pixels around an image. For example, say I have an 5x5 image like this:
OOOOOOXOXOOXXOOOOOOOOOOOO
(O = transparent pixel. X = opaque pixel)
I'd like to get this 3x2 output:
XOXXXO
In other words, I'd like to trim out as many as transparent pixels around, while keeping opaque pixels untouched.
But I can't figure out how to do this. COPVOP seems to work pixel by pixel, but in this case I need to get position of the topmost/bottommost/leftmost/rightmost opaque pixels first. How to do this in COP?
My method would be to apply the original image onto a grid. Each primitive representing the pixel with the opacity value. From there, you could use some vex to get what resolution you need to fit the opaque section and forward those info into a COPs network.
Sorry for being super vague but I don't have the time to go into details...
There is a iautocrop [www.sidefx.com] command line tool you could try. I've not used it, so might not work as you want. I would suggest trying something like