Methods and apparatuses process images. The method according to one embodiment accesses digital image data representing an image including an object generates a connected graph associated with the image, the generating step including representing pixels of the image in a higher than two dimensional space to obtain pixel representations, generating a pixel representation graph using the pixel representations, and assigning weights to edges between the pixel representations in the pixel representation graph, based on a gradient characteristic between the pixel representations, to obtain a connected graph and segments the connected graph using an energy minimizing function, to obtain pixels of the image associated with the object.