fix rgb optimization