({{, (RefLink[ImageAdjust, paclet:ref/ImageAdjust])[image] 
adjusts the levels in image, rescaling them to cover the range 0 to 1.}, {, (RefLink[ImageAdjust, paclet:ref/ImageAdjust])[image,corr]
adjusts the image according to the correction specification corr.}, {, (RefLink[ImageAdjust, paclet:ref/ImageAdjust])[image,corr,{(Subscript[in, min]),(Subscript[in, max])}]
first rescales so that the range of input values (Subscript[in, min]) to (Subscript[in, max]) is mapped to 0 to 1.}, {, (RefLink[ImageAdjust, paclet:ref/ImageAdjust])[image,corr,{(Subscript[in, min]),(Subscript[in, max])},{(Subscript[out, min]),(Subscript[out, max])}]
rescales so that the range of input values (Subscript[in, min]) to (Subscript[in, max]) is mapped to (Subscript[out, min]) to (Subscript[out, max]).}})

OpenersNotesSection(Spacer1)Details

ImageAdjust can be used for adjusting pixel values so that more of the image content is in the visible range or to correct for bad illumination or contrast.

(RefLink[ImageAdjust, paclet:ref/ImageAdjust]) works with arbitrary 2D and 3D images.

Correction corr for contrast, brightness and gamma correction can take any of the following settings:

Zero adjustment corresponds to contrast adjustment 0, brightness adjustment 0, gamma correction 1.

When rescaled values lie outside the range (Subscript[out, min]) to (Subscript[out, max]), they are clipped.

All correction and range parameters can be given as lists to specify different treatment for different channels in the image.

Range parameters can be set to (RefLink[Automatic, paclet:ref/Automatic]) to indicate the minimum or maximum of the values that occur in the image.

When applied to color images, (RefLink[ImageAdjust, paclet:ref/ImageAdjust]) always returns an RGB image.

OpenersPrimaryExamplesSection(Spacer1)Examples  (16)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Auto adjust values of a color image:

ImageAdjust[]

Perform a gamma correction

ImageAdjust[,{0,0,1.8}]

OpenersExampleSection1(Spacer1)Scope  (4)

Increase the contrast and brightness of an image:

ImageAdjust[,{0.5,0.1}]

Increase the brightness and perform a gamma correction:

ImageAdjust[, {0,0.2,1.9}]

Adjust the input range:

ImageAdjust[,{0,0,1},{0.0,0.8}]

Adjust the input range using channel-specific settings:

ImageAdjust[,{0,0,1},{{Automatic,.1,.1},{Automatic,.5,.6}}]

OpenersExampleSection3(Spacer1)Applications  (4)

Use gamma values in the range 0<γ<1 to see more details in dark areas of an image:

ImageAdjust[,{0,0,0.3}]

Use values γ>1 to see more details in a washed-out image:

ImageAdjust[,{0,0,3}]

Adjust to see relative distances returned by (RefLink[DistanceTransform, paclet:ref/DistanceTransform]):

DistanceTransform[]

ImageAdjust[%]

Adjust to see out-of-range values returned by (RefLink[LaplacianGaussianFilter, paclet:ref/LaplacianGaussianFilter]):

log=LaplacianGaussianFilter[,1]

ImageMeasurements[log,{"Min","Max"}]

ImageAdjust[log]

Adjust very small values in a 3D image:

Image3D[GaussianMatrix[2{{10,10,10}}],ImageSize->200]

ImageAdjust[%]

OpenersExampleSection4(Spacer1)Properties & Relations  (4)

For grayscale images, (RefLink[ImageAdjust, paclet:ref/ImageAdjust])[(RefLink[Image, paclet:ref/Image])[data]] is equivalent to (RefLink[Image, paclet:ref/Image])[(RefLink[Rescale, paclet:ref/Rescale])[data]]:

data=GaborMatrix[100,{.1,.1}];

{res1=ImageAdjust[Image[data]],
res2=Image[Rescale[data]]}

Max[ImageData[res1]-ImageData[res2]]//Chop

(RefLink[ImageAdjust, paclet:ref/ImageAdjust])[image] is equivalent to (RefLink[ImageAdjust, paclet:ref/ImageAdjust])[image,{0,0,1},{min,max},{0,1}] where {min,max} is the channel-wise pixel ranges in image:

i=;

ImageAdjust[i]==ImageAdjust[i,{0,0,1},ImageMeasurements[i,{"Min","Max"}],{0,1}]

(RefLink[ImageAdjust, paclet:ref/ImageAdjust])[image,-2] is equivalent to (RefLink[ColorNegate, paclet:ref/ColorNegate])[image]:

{res1=ImageAdjust[i,-2],res2=ColorNegate[i]}

ImageData[res1]==ImageData[res2]

(RefLink[ImageAdjust, paclet:ref/ImageAdjust])[image,-1] returns a constant image:

ImageAdjust[i,-1]

Image contrast increases as contrast value c is varied from -1 to ∞:

Table[ImageAdjust[i,c],{c,{-1/2,1/2,2}}]

(RefLink[ImageAdjust, paclet:ref/ImageAdjust])[image,{c,b,γ}] is equivalent to (RefLink[ImageApply, paclet:ref/ImageApply])[(RefLink[Clip, paclet:ref/Clip])[(b+1)(c+1)((#)^γ)-c/2,{0,1}]&,image]:

c=.2;b=-.2;γ=1.2;
{res1=ImageAdjust[i,{c,b,γ}],res2=ImageApply[Clip[(b+1)(c+1)#^γ-c/2,{0,1}]&,i]}

ImageData[res1]==ImageData[res2]

XXXX

The image is not changed if the input and the output range are identical:

ImageAdjust[ ,{0,0,1},{0.2,0.4}, {0.2,0.4}]

OpenersExampleSection5(Spacer1)Possible Issues  (2)

Noise may get amplified for images with small color variation:

ImageAdjust[]

(RefLink[ImageAdjust, paclet:ref/ImageAdjust]) may introduce new colors, as all channels are scaled independently:

img=;

ImageAdjust[img]

Perform a global adjustment:

ImageAdjust[img,{0,0,1},MinMax[img]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Lighter, paclet:ref/Lighter])  ▪  (RefLink[Darker, paclet:ref/Darker])  ▪  (RefLink[BrightnessEqualize, paclet:ref/BrightnessEqualize])  ▪  (RefLink[ImageClip, paclet:ref/ImageClip])  ▪  (RefLink[ImageHistogram, paclet:ref/ImageHistogram])  ▪  (RefLink[Rescale, paclet:ref/Rescale])  ▪  (RefLink[HistogramTransform, paclet:ref/HistogramTransform])  ▪  (RefLink[ColorToneMapping, paclet:ref/ColorToneMapping])  ▪  (RefLink[ColorBalance, paclet:ref/ColorBalance])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Image Processing, paclet:tutorial/ImageProcessing])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Basic Image Manipulation, paclet:guide/BasicImageManipulation])}, {▪(RefLinkPlain[Color Processing, paclet:guide/ColorProcessing])}, {▪(RefLinkPlain[Image Processing & Analysis, paclet:guide/ImageProcessing])}, {▪(RefLinkPlain[Image Restoration, paclet:guide/ImageRestoration])}, {▪(RefLinkPlain[Computational Photography, paclet:guide/ComputationalPhotography])}, {▪(RefLinkPlain[Scientific Data Analysis, paclet:guide/ScientificDataAnalysis])}, {▪(RefLinkPlain[Machine Learning, paclet:guide/MachineLearning])}, {▪(RefLinkPlain[Image Computation for Microscopy, paclet:guide/ImageComputationForMicroscopy])}})}})