Un-painting by numbers