Quoting from Nature magazine's "Image integrity" guidelines:

Processing (such as changing brightness and contrast) is appropriate only when it is applied equally across the entire image and is applied equally to controls. Contrast should not be adjusted so that data disappear. Excessive manipulations, such as processing to emphasize one region in the image at the expense of others (for example, through the use of a biased choice of threshold settings), is inappropriate, as is emphasizing experimental data relative to the control.

When I change the brightness and contrast of an image, say, with the following command:

ImageAdjust[ExampleImage, {contrast, brightness}]

Is it fair to say that contrast and brightness transformations are "applied equally across the entire image" in the spirit of the above quotation? Of course common sense is required in terms of not purposefully obscuring meaningful data, but are there pitfalls / issues I should otherwise be aware of specifically with regards to this sort of image manipulation in Mathematica?


In a word, "yes". ImageAdjust operates the same on each pixel value. To see this, consider an "image"

img=Image[{{1, 2, 3}, {1, 2, 4}, {1, 2, 5}}]

You won't see anything. But if you adjust it:


you see a small 3 by 3 block of black and white. If you look at the numbers using


then you get:

{{0., 0.25, 0.5}, {0., 0.25, 0.75}, {0., 0.25, 1.}}

So all the 1's have gone to 0, ll the 2's have gone to 0.25, etc. The largest value has gone to 1.

  • 1
    $\begingroup$ However, pixel values must not clip and quantization noise should not be significant if bias isn't to be introduced in this process. Perhaps one can get away with working with 64-bit floating point images in a defined (and preferably linear) color space. Of course the best approach is to make the unprocessed data and the code for processing it available to the readers rather than forcing them to rely on pre-prepared figures. $\endgroup$ – Oleksandr R. Mar 24 '13 at 16:35
  • $\begingroup$ @OleksandrR. Making the scripts available is precisely what I plan to do. $\endgroup$ – Bob Mar 24 '13 at 20:17
  • 1
    $\begingroup$ With a stricter meaning of "fairness", ImageAdjust[img] is not "fair" because the operation relies on the min and max pixel values of the image: these min and max values are typically very sensitive to noise. $\endgroup$ – Matthias Odisio Mar 25 '13 at 15:16

(Would have applied an "honorable" tag to the question if possible)

It is fair to use ImageAdjust[image, {contrast, brightness}] both for your "control" image and "data" image, because with these settings the exact same formula will be used for both images.

It's not always true with all syntactic forms of ImageAdjust. For example, ImageAdjust[img] will use image-specific data in the underlying formula, and therefore a source of potential "unfairness." In some scenario it would not be fair to have the displayed output rely heavily on the value of a noisy dark pixel, for example.

  • $\begingroup$ Thanks - that's a very good point. This is precisely the sort of reason I prefer using Mathematica to a program like Photoshop where it's not at all clear what's going on. $\endgroup$ – Bob Mar 25 '13 at 16:16
  • $\begingroup$ What do contrast and brightness adjustments mean exactly, mathematically? What does ImageAdjust do precisely? Is is the same that is described here? (It can't be because the neutral contrast adjustment is `0 in Mathematica) $\endgroup$ – Szabolcs Mar 25 '13 at 18:35
  • $\begingroup$ @Szabolcs I know it does not answer precisely your question, but yes, computations are conceptually similar to the ones you pointed to. $\endgroup$ – Matthias Odisio Mar 25 '13 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.