Please explain this color blending mode formula so I can replicate it in PHP/ImageMagick

后端 未结 4 477
梦如初夏
梦如初夏 2021-01-12 21:46

I\'ve been trying to use ImageMagick to replicate Photoshops Colour Blend Mode. I found the following formulas in an online guide but I don\'t know what they mean. Do I just

4条回答
  •  不要未来只要你来
    2021-01-12 22:21

    Wikipedia has a good article on blend modes http://en.wikipedia.org/wiki/Blend_modes

    They give formulas for Multiply, Screen and Overlay modes.

    Multiply
    Formula: Result Color = (Top Color) * (Bottom Color) /255
    
    Screen
    Formula: Result Color = 255 - [((255 - Top Color)*(255 - Bottom Color))/255]
    
    Overlay
    Formula: Result Color = if (Bottom Color < 128) 
        then (2 * Top Color * Bottom Color / 255) 
        else (255 - 2 * (255 - Top Color) * (255 - Bottom Color) / 255)
    

提交回复
热议问题