awt - How to get the Shape of the transparent portion of a BufferedImage in Java? -


i have bufferedimage image objects have transparent pixels. i'd shape or area objects enclose transparent portion of image.

you try way: treat original image undirected graph nodes transparent pixels. put edge between adjacent nodes on image (i.e. transparent pixels directly above, left, right, below, , diagonal). find connected components graph. each connected component, compute convex hull. return list containing each of hulls, each hull being shape.


Comments