public int[] getDiffractionImage() {

		if (pixels == null)
			pixels = new int[width * height];

		float min = Float.MAX_VALUE;
		float max = -min;
		int n = width * height;
		for (int k = 0; k < n; k++) {
			min = Math.min(min, f[k]);
			max = Math.max(max, f[k]);
		}

		n = 0;
		int c;
		float delta;
		switch (lod) {
		case LOG_SCALING:
			delta = (float) Math.log(max - min + 1) / 255.0f;
			for (int j = 0; j < width; j++) {
				for (int i = 0; i < height; i++) {
					c = (int) (Math.log(f[n] - min + 1) / delta);
					pixels[n++] = 0xff << 24 | c << 16 | c << 8 | c;
				}
			}
			break;
		case LINEAR_SCALING:
			delta = (max - min) / 255.0f;
			for (int j = 0; j < width; j++) {
				for (int i = 0; i < height; i++) {
					c = (int) ((f[n] - min) / delta);
					pixels[n++] = 0xff << 24 | c << 16 | c << 8 | c;
				}
			}
			break;
		}

		return pixels;

	}