I want to compose three single exposures into an RGB image.

I have three 2D arrays that represent each exposure and I can combine them into a 3D array, specifying the RGB values for each pixel. My problem is that the third exposure is not bright enough, and I want to make it brighter.

If I want to make an Image brighter, I just use Lighter[image] and that sorts it. But in this case, I want to increase the brightness of only one of the three exposures, so I think I need to work with the array.

In the documentation, they state:

ImageAdjust[Image[data]] is equivalent to Image[Rescale[data]]

How do I implement it?

What I have done:

Code for reference:

 {imageR = array5000/Max[array5000],
  imageG = array1000/Max[array1000],
  imageB = array100/Max[array100],
 rgb = Table[{imageR[[i, j]], imageG[[i, j]], imageB[[i, j]]}, {i, 
    pixels}, {j, pixels}];
 Export["buddhaBrot.jpg", Image[rgb]]

The result of


is too dark, whereas I would like it to be like

  • $\begingroup$ Wait ... if you know that you want Lighter@Ligther@Image[array5000/Max[array5000]]. ... why don't you just do that? $\endgroup$ Mar 22, 2016 at 13:38
  • $\begingroup$ Also, what are array5000 etc.? $\endgroup$ Mar 22, 2016 at 13:39
  • $\begingroup$ Also, you can use the arguments of ImageAdjust[image, {contrast, brightness, gamma}] $\endgroup$ Mar 22, 2016 at 13:39
  • $\begingroup$ BTW ... Have you seen this mathematica.stackexchange.com/q/9342/193 ? $\endgroup$ Mar 22, 2016 at 13:39
  • $\begingroup$ Perhaps you mean ImageExposureCombine $\endgroup$
    – yode
    Mar 22, 2016 at 13:41

1 Answer 1


First, convert your data arrays to images with Image[].

If your imageR and imageG have good brightness, and imageB is too dark:

meanIntensity = Mean[ImageMeasurements[#, "MeanIntensity"]& /@ {imageR, imageG}]
badIntensity = ImageMeasurements[imageB, "MeanIntensity"]
imageBadj = ImageMultiply[imageB, meanIntensity/badIntensity]

combinedImage = ColorCombine[{imageR, imageG, imageBadj}]

should give you a color image with all channels appropriately bright.

  • 1
    $\begingroup$ It's not what I asked, but turns out you knew what I wanted better than me :) $\endgroup$
    – Andrea
    Mar 23, 2016 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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