public void putPixelSafe(int x, int y, float value) { if (x >= 0 && x < width && y >= 0 && y < height) { pixels[y,x] = value; } }