====== Flatten ====== Flatten divides an image by its corresponding "flat" image (flat fielding), which corrects for uneven illumination. Connect the image to **input_link** and the flat image to **flat_link**. Before the division, a dark value is subtracted from each image. Enter the dark values in "darks": one or two numbers, for the input image and for the flat image. ===== Requirements ===== * Both images must be the same size and have the same number of bands. They can be multiband images. * Input values below 0.0 are set to 0.0. Flat values of 0.0 or less are set to 1.0. ===== Integer and floating-point flats ===== * If the flat pixel values are **unsigned integers**, all the flats are read into memory, so that the average value of each flat can be measured. * If they are **floating point**, Flatten assumes the flats are already scaled, each divided by its average value. They are then read one scanline at a time, which needs less memory. The output is floating point.