Another method (with more control) is to import the picture into a raster editing program (like GIMP, photoshop etc) and use a mosaic filter to break up the image into large squares of uniform colour. You can then use the colour picker to sample all the colours on the page (some programs have an automatic script which does this for you with one click).