Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Simple question: Is there any built in function for images that acts similar to imagesc in matlab, i.e. take grayscale image scale it to use full [0,1] range and then use some kind of colorgradient to plot the image?

The one thing I use right now is to first use HistogramTransform to scale to full [0,1] range then obtain image data via ImageData and then use ArrayPlot with appropriate ColorFuntion:

ArrayPlot[image // HistogramTransform // ImageData, ColorFunction -> "TemperatureMap"]

Of course this works just fine, but I am curious if I overlooked some procedure operating directly on images.

share|improve this question
Colorize does what you need? – Kuba Aug 15 '13 at 12:50
imagesc is like ImageAdjust – bill s Aug 15 '13 at 13:29
Ok, thanks guys. For some reason I did not see that Colorize works directly with Images, too. So a combination of Colorize and ImageAdjust should do the job. – Wizard Aug 15 '13 at 14:05
up vote 3 down vote accepted

As suggested in the comments ImageAdjust and Colorize is one way to go

img = ImageMultiply[ExampleData[{"TestImage", "Aerial"}], .1]
Colorize[ImageAdjust[img], ColorFunction -> "SunsetColors"]

Another way is to use the ImageApply and transform the colors with ColorData. On this occasion let me point out, that Blend can be used too (it's 4 characters shorter :-)

ImageApply[List @@ Blend["SunsetColors", #] &, ImageAdjust[img]]

Mathematica graphics

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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