Change image color

i have 2 images a and b which is listed below. my both images are in rgb format . i want to change color of “b” image like “a” image by processing. tell me how it is possible.

if the question is more general like:

if there is pixels with color black in image a,
change image b same pixels to black.
that would be like superimpose
and there it would not matter that there is a red “A” in image b.

but as more i think about that it makes less sense.

anyhow start loading the images,
read the color of image a
in a for loop over all pixels and use
https://processing.org/reference/get_.html

now post your running code here for the next step.

1 Like

Start here:
https://processing.org/

https://processing.org/tutorials/

https://processing.org/tutorials/color/
https://processing.org/tutorials/pixels/

https://processing.org/reference/
https://processing.org/examples/

There are examples in the Processing software also.

:slight_smile:

1 Like

It is important to understand the image type that one is working with.


“JPEG is not well suited for line drawings and other textual or iconic graphics, where the sharp contrasts between adjacent pixels can cause noticeable artifacts.”

This is what I get when I fill colours with Paint (Microsoft application):
a
b

:slight_smile:

1 Like

Yes very correct ! But OP seems to be using only two very distinctive colors so should be ok !

Don’t bet on it - that’s one of the worst case scenarios.

2 Likes