Restoring paint code