1. A method in a computing device for generating a compact representation of an image, the method comprising: for each of a plurality of blocks of pixels of the image, calculating for the block a representative intensity level derived from intensities of the pixels of the block; performing a discrete transform on the representative intensity levels for the blocks to generate transformed coefficients; applying a principal component analysis to the transformed coefficients to generate PCA coefficients of a reduced dimensionality; and setting each bit of a vector with an element corresponding to a PCA coefficient based on the value of the PCA coefficient wherein the bits represent the compact representation of the image.