0
$\begingroup$

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:

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

The result of

Image[array5000/Max[array5000]] 

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

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

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.

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

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.