I would like to use a set of two images with the same color scheme (img1
and img2
) to produce a new image (img3
) in which each pixel corresponds to the "higher pixel color value" of img1
and img2
.
Imagine objects (e.g. disks) in img1
have the color col1
:
col1= ColorData["TemperatureMap"][0.5]
In img2
the disks are at different positions (partly overlapping with img1
), they should have the color col2
:
col2= ColorData["TemperatureMap"][0.2]
For the resulting image img3
we should check if objects in img1
and img2
overlap there. If so, then the pixel gets the color col1
(because 0.5 > 0.2
).
If at a pixel only one of the images has an object, then color remains the same. A scheme with only three colors might look like this:
- blue AND red --> red
- blue AND background --> blue
- background AND red --> red
img1
isRGB[.5,.1,.3]
andimg2
isRGB[.4,.2,.4]
... what do you want as result? $\endgroup$value -> {r,g,b}
which you use to createimg1
andimg2
has (in general) no inverse. What you can do is to calculate the max before you turned your gray values into colors, but this is what bill has already shown you in his answer. $\endgroup$