// f should return a value between 0 and 1 (will be clamped for you) static FloatBWImage floatBWImageFromFunction(int w, int h default w, IF2_IntInt_Double f) { FloatBWImage img = new(w, h); for y to h: for x to w: img.setPixel(x, y, (float) f.get(x, y)); ret img; } static FloatBWImage floatBWImageFromFunction(int w, int h default w, IF0 f) { ret floatBWImageFromFunction(w, (x, y) -> f!); }