File size: 253 Bytes
2e7060e
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import matplotlib.pyplot as plt
import numpy as np


rgb = 'woman.png'
mask = 'woman_mask.png'
ofile = 'test1.png'

rgb = plt.imread(rgb)
mask = plt.imread(mask)

output = np.concatenate([rgb[..., :3], mask[..., :1]], axis=2)
plt.imsave(ofile, output)