Bug in ImageAdjust
introduced in 8.0.4 or earlier and fixed in 11.0
Documentation bug for ImageAdjust
introduced in 8 or earlier and fixed in 11.1.0
In version 11.1.0 the first statement under "Properties & Relations" reads as (emphasized words are absent in version 11.0.1): "For grayscale images, ImageAdjust[Image[data]]
is equivalent to Image[Rescale[data]]
".
A recent thread raised several concerns regarding the Documentation page for ImageAdjust
.
The first issue is related to the first statement under the "Properties & Relations" on the Documentation page for ImageAdjust
:
ImageAdjust[Image[data]]
is equivalent toImage[Rescale[data]]
.
This statement is incorrect for two reasons:
As george2079 correctly notes, "For color images
ImageAdjust
works independently on each channel whileRescale
applies a single transformation to the whole data array."Actually even for single-channel images
Image[Rescale[data]]
produces slightly different image as it is clear from the example provided:data = GaborMatrix[100, {.1, .1}]; res1 = ImageAdjust[Image[data]]; res2 = Image[Rescale[data]]; Max[ImageData[res1] - ImageData[res2]]
2.77556*10^-17
From the other hand, if we try to use the code for the second statement under the "Properties & Relations" for the above single-channel image we obtain exactly identical image:
ImageAdjust[Image[data]] == ImageAdjust[Image[data], {0, 0, 1}, ImageMeasurements[Image[data], {"Min", "Max"}], {0, 1}]
True
From the above it is clear that for single-channel images the correct statement should be: "ImageAdjust[Image[data]]
is equivalent to ImageAdjust[Image[data], {0, 0, 1}, ImageMeasurements[Image[data], {"Min", "Max"}], {0, 1}]
."
The second issue is related to the above-mentioned code for the second statement under the "Properties & Relations". This code simply does not work with the provided color image and produces error (checked with version 10.2 on Windows 7 x64):
Does it mean that ImageAdjust
does not allow to specify separate range for each channel as george2079 states in the comment? In this case, then we have a bug in the Documentation (see the statement on the above screenshot). An alternative is that we have a bug in ImageAdjust
.
What do you think about the first issue? Is it a Documentation bug?