Subscribe to this thread
Home - General / All posts - Multiply blend of two images
Mike Pelletier


2,138 post(s)
#11-Jun-24 23:16

Hopefully someone smarter than me can assist with how to achieve a multiply blend of 2 images in Mfd 9. The attached map file has a clip of a RGBa aerial and a grayscale image that highlights edges from a DEM. It also has a query that creates a new RGB image and attempts to perform the multiply blend.

The image the query makes is poor and it appears that it's more complicated than a simple multiplication of the two images. I divided the grayscale image by 255 in an unsuccessful attempt to compensate.

To keep the file size small, you have to run the query to see the result. Appreciate any suggestions.

Attachments:
Multiply blend aerial and dem.map

Dimitri


7,452 post(s)
#12-Jun-24 05:11

According to Wikipedia, a multiply blend is...

Multiply[edit]

Multiply blend mode takes the RGB channel values from 0 to 1 of each pixel in the top layer and multiplies them with the values for the corresponding pixel from the bottom layer. Wherever either layer was brighter than black, the composite is darker; since each value is less than 1, their product will be less than each initial value that was greater than zero.

𝑓(𝑎,𝑏)=𝑎𝑏,

where a is the base layer value and b is the top layer value.

This mode is commutative: exchanging two layers does not change the result. If the two layers contain the same picture, multiply blend mode is equivalent to a quadratic curve, or gamma correction with γ=2. For image editing it is sometimes more convenient to simply go to the Curves dialog of the software, because it gives more flexibility in the shape of the curves. Or one can use Levels dialog: the middle number is usually 1/γ, so one can just type 0.5.

If one layer contains a homogeneous color, such as the gray color (0.8, 0.8, 0.8), multiply blend mode is equivalent to a curve that is simply a straight line. This is also equivalent to using this gray value as opacity when doing "normal mode" blend with a black bottom layer.

You must express RGB values for each channel in both images not as a value from 0 to 255 but as a fractional value from 0 to 1. I haven't looked at your query so I don't know if you're doing that. You also, of course, must convert back from the resulting fractional value into values from 0 to 255 to color pixels in the resulting image.

Mike Pelletier


2,138 post(s)
#12-Jun-24 22:41

Thanks Dimitri for getting me on track. The attached map has the corrected query. First run the query to create the blend image and then run the blend query to see the result. There's a value (@BlendPercent} to adjust that lets you play with how much affect it has on the original image. It's not very impressive on the tiny image in the project, but I'm rather excited about the results on the full data set.

To use the query on your own data, you need to figure out the max data range, but ignoring extreme values outside the general values in your greyscale image. Add those values in the query to create fractional values for the greyscale as Dimitri explained.

There's probably better ways to set this up. As is though, it's not that difficult to experiment with settings and different DEM manipulations.

Mike Pelletier


2,138 post(s)
#12-Jun-24 22:44

Here's the original Bing aerial for a small portion of my area.

Attachments:
BingAerial.PNG

Mike Pelletier


2,138 post(s)
#12-Jun-24 22:45

Here it is blended with a DEM that has been run through the Dual Prewitt Filter (I believe) example in the manual. It gives it a glossy look.

Attachments:
Blend.PNG

Mike Pelletier


2,138 post(s)
#12-Jun-24 22:55

Here's a screenshot showing the blend on a larger area. BTW, the Bing image for my area has nice color showing realistic vegetation at zoomed out levels. Hope to use it in blends with DEM for a realistic and informative background on many maps.

Attachments:
BlendBiggerArea.PNG

Mike Pelletier


2,138 post(s)
#12-Jun-24 23:08

Here's the same blend with more of the greyscale, giving it richer tones. Using higher resolution in the aerial will help make it sharper at these more zoomed in levels. Sorry for so many posts!

Attachments:
BlendDarker.PNG

Dimitri


7,452 post(s)
#13-Jun-24 05:41

Wow! That's a great effect from a nice query. Definitely one to add in my archive of cool tools.

Mike Pelletier


2,138 post(s)
#13-Jun-24 15:27

Oops. Here's the corrected query mentioned in the post above.

Attachments:
Multiply blend aerial and dem.map

Dimitri


7,452 post(s)
#14-Jun-24 11:32

Maybe just a figment of my imagination, but could that be an impact crater to the Southwest of Gunnison? The image processing brought out what looks like a clearly circular feature.

Here it is in unprocessed Bing satellite imagery, reprojected into an Orthographic projection centered on 38.5 N and 107 W. I used Ortho so a circular buffer at that location looks like a circle. The text for a Location (if you want to create one to find it in Bing) is

{ "Center": [ -106.97294746360761, 38.482833635885264 ], "Entity": "[Map 2]", "Scale": 95949.43312403146 }

Without a circle overlaid:

With a circle overlaid:

The circular feature looks more obvious in Mike's BlendDarker image that he posted. Such circular arrangements of geographic features are pretty darned rare as a matter of random landforms. They're usually impact craters, volcanic remnants or similar non-random geologic relics.

It would be interesting if any Colorado geologists have looked into the possibility of a very eroded impact site at that location. If it turns out to be a new one, well, credit for the discovery of the Gunnison Crater goes to Mike Pelletier for outstanding image processing and yours truly for seeing a circular feature. :-)

Attachments:
gunnison_crater_01.png
gunnison_crater_02.png

Dimitri


7,452 post(s)
#14-Jun-24 13:20

Adding one more image, here is the famous 1979 Tweto map of Colorado geology in the region of the circular feature, which I've georeferenced to the map (the "geotiff" download on the USGS website is wrong and so the image needs georeferencing).

The Xg region indicates granitic rocks, I believe.

This is just to the north of the San Juan Mountains batholith complex within the Gunnison uplift, but it is not one of the volcanic calderas in the San Juan complex, like the Lake City Caldera much further south. So whatever it is, it doesn't strike me as volcanic. But the circular extent of granitic rocks does add to the distinctiveness of the feature.

Attachments:
gunnison_crater_03.png

artlembo


3,412 post(s)
#14-Jun-24 14:02

looks like a ring dike.

Mike Pelletier


2,138 post(s)
#14-Jun-24 14:21

Pretty sure the volcanic ring dike theory is the leading candidate of the academics around here. We have a Geology Dept. at the local college in town. However, the crater explanation has been proposed as well, including it being part of a series of craters across the U.S. from a large meteorite that broke up before landing. This area has a very volcanic past, making it fun to map. Like your thinking Dimitri!

artlembo


3,412 post(s)
#14-Jun-24 14:26

it might be cool to see if there is some way to tease out more of these to determine if they have followed a particular path. That could be a fun project to work on with the local university.

Mike Pelletier


2,138 post(s)
#14-Jun-24 15:00

Possibly. There's lots of volcanic features out there. In the attached, I circled in red the ring Dimitri pointed out, in blue some of the more distinct large volcanic mountains, and in black a few of the many laccoliths in the area.

On another side note, I'm no photo manipulating expert, but it seems pretty handy that we can adjust the blend level for each channel by adding some simple math to the query (shown below), rather than trying to adjust color tones afterwards. Makes for lots of enjoyable tinkering.

Attachments:
Capture.PNG

Manifold User Community Use Agreement Copyright (C) 2007-2021 Manifold Software Limited. All rights reserved.