1. A method comprising: segmenting, by one or more processors, an image having an array of image pixels into a plurality of patches, each patch including one or more of the image pixels; generating a graph of the image, the graph comprising a set of patch nodes and a set of internal edges connecting the patch nodes to each other, the set of patch nodes corresponding to the plurality of patches and including a subset of patch nodes corresponding to boundary patches at a boundary of the image; adding a virtual background node to the set of patch nodes of the graph; connecting the subset of patch nodes corresponding to the boundary patches to the virtual background node by a set of boundary edges; computing, by the one or more processors, a length of a shortest path from each patch node to the virtual background node; and designating respective lengths as a saliency value for each patch to create a saliency map of the image.