Set the index value for palette images, or the red channel otherwise.
void setPixelIndex(int x, int y, num i) => data?.setPixelR(x, y, i);