I would like to convert an RGB image to a different color. I know how to convert to grayscale using ColorConvert, but I can’t figure out how to change it to a custom RGB color.
I am not sure whether I can answer that question. In your image there are many different shades of colours. If you save that image in the variable “img” you get:
DominantColors[img, 10]
I can of course use one of the colours and substitute it by another RGB colour:
If you have a large range of colours and you want to change them to different RGB combinations, you obviously need some kind of rule to convert all colours.
@Kuba Podkalicki and @Marco Thiel gave excellent answers. I’d like to make a short note. When you would like to change the color you basically asking for a function mapping from existing RGB channels’ values to new ones. The most general function that does it is ImageApply. Look through numerous examples there. You can apply function directly to the channels vector {R,G,B} or different or mixed functions of separate channels. My favorite example is selective-coloring or color-splashing. Imagine you have an image: