# Overlaying a specifc color with LinearLight or Multiply -> reverse color maths

We have source images in gray or white color and want to overlay a specific color via imagemagick's composite function.

Currently we generate a solid color area and use composite-overlay to overlay the color. Now most of the shadows are lost.

The new approach is to use LinearLight compositing, but here we have to use a different source color to obtain the specific target color.

The formular use for linearlight seems

2*Src + Dest - 1


But how do I apply the reverse of this to a specific color hex code?

• It's hard to understand what you are asking here. Can you add more details and be more specific about what your question is? What do you mean by "the reverse of this" with regard to that formula? – Nathan Reed Mar 14 at 18:08