Wolfram Research

ImageColorReplace

Contributed by: Arnoud Buzing

Source Notebook

Replace color pixels from one image, with corresponding pixels from another image

ResourceFunction["ImageColorReplace"][image1, image2]

replaces dominant color pixels from image1, with corresponding pixels from image2

ResourceFunction["ImageColorReplace"][image1, image2,color]

replaces pixels of color color from image1, with corresponding pixels from image2

Details and Options

ImageColorReplace can be used to replace ‘green screen’ images with a custom background.

Examples

Basic Examples

Find the dominant color of an image, and replace those pixels with the pixels from another image:

In[1]:=
CloudGet["https://www.wolframcloud.com/objects/e843aa14-880b-47ef-ac06-5318e56053fa"] (* Evaluate this cell to copy the example input from a cloud object *)
Out[1]=

Do the same thing, but with a ‘blue screen’ image:

In[2]:=
CloudGet["https://www.wolframcloud.com/objects/5465c622-c71f-463f-a037-bb4ab2bf1aac"] (* Evaluate this cell to copy the example input from a cloud object *)
Out[2]=

Superimpose a spaceship over a desert:

In[3]:=
CloudGet["https://www.wolframcloud.com/objects/b074fe06-3c0c-4370-b3ae-fb3375a8b6ba"] (* Evaluate this cell to copy the example input from a cloud object *)
Out[3]=

Resource History