overlay

Import packages

import numpy as np
import porespy as ps
import scipy.ndimage as spim
import matplotlib.pyplot as plt
import skimage
ps.visualization.set_mpl_style()
[01:03:31] ERROR    PARDISO solver not installed, run `pip install pypardiso`. Otherwise,          _workspace.py:56
                    simulations will be slow. Apple M chips not supported.                                         

Create image and variables

im1 = np.ones([100, 100, 100])
im2 = np.ones([51, 51, 51])
im1 = ps.generators.random_spheres(im=im1, r=25, phi=0.5, value=2) - 1
im2 = ps.generators.random_spheres(im=im2, r=5, phi=0.5, value=3) - 1
im3 = im1.copy()

fig, ax = plt.subplots(figsize=[4, 4]);
ax.imshow(im1[50, ...], vmin=0, vmax=3);
ax.axis(False)
fig, ax = plt.subplots(figsize=[4, 4]);
ax.imshow(im2[25, ...], vmin=0, vmax=3);
ax.axis(False);

Apply tool

im = ps.tools.overlay(im1=im1, im2=im2, c=[26, 26, 26])
fig, ax = plt.subplots(figsize=[4, 4])
ax.imshow(im[25, ...], vmin=0, vmax=3)
ax.axis(False);
im = ps.tools.overlay(im1=im3, im2=im2, c=[74, 74, 74])
fig, ax = plt.subplots(figsize=[4, 4])
ax.imshow(im[75, ...])
ax.axis(False);