First of all, I would like to say that I have tried searching for this on Google and forums a lot, but I haven't been able to find a solution. I apologize if this topic has already been solved somewhere else.
So, I want to replace pure RGB colors (#ff0000, #00ff00, #0000ff) by 3 other colors (#b748b2, #a03c9b, #db77b7). I'm trying to use the "-color-matrix" command line, but I'm not sure if it's possible and what I have to put to the matrix.
Here is what I tried:
Code: Select all
colorR.r/255 colorR.g/255 colorR.b/255 0 0,
colorG.r/255 colorA.G.g/255 colorG.b/255 0 0,
colorB.r/255 colorB.g/255 colorB.b/255 0 0,
0 0 0 1 0,
0 0 0 0 0
So my final formula is something like this:
Code: Select all
convert in.png -color-matrix "00.282352941 0.717647059 0.301960784 0 0, 0.37254902 0.764705882 0.392156863 0 0, 0.141176471 0.533333333 0.282352941 0 0, 0 0 0 1 0, 0 0 0 0 0" out.png
I'm using ImageMagick 6.9.6-6 Q16 using macOS command line.
Many thanks!