Function Repository Resource:

ImageColorReplace

Source Notebook

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

Contributed by: Arnoud Buzing

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

ResourceFunction["ImageColorReplace"] can be used to replace a green screen image background.

Examples

Basic Examples (3) 

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

In[1]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/a2e1eb90-4237-4f07-aa2f-74ba28ae7712"]
Out[1]=

Do the same thing but with a blue screen image:

In[2]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/ff72ef30-a5ac-4ca3-93e2-2f333ec80e23"]
Out[2]=

Superimpose a spaceship over a desert:

In[3]:=
(* Evaluate this cell to get the example input *) CloudGet["https://www.wolframcloud.com/obj/88fcb2f0-bc90-4903-ac44-3ed843747c68"]
Out[3]=

Publisher

Arnoud Buzing

Requirements

Wolfram Language 11.3 (March 2018) or above

Version History

  • 1.0.0 – 06 February 2019

License Information