iOS: Applying a RGB filter to a greyscale PNG

后端 未结 3 1378
抹茶落季
抹茶落季 2020-12-14 13:17

I have a greyscale gem top view.

(PNG format, so has alpha component)

3条回答
  •  天涯浪人
    2020-12-14 14:11

    The easiest way to do it is to draw the image into an RGB-colorspaced CGBitmapContext, use CGContextSetBlendMode to set kCGBlendModeColor, and then draw over it with a solid color (e.g. with CGContextFillRect).

提交回复
热议问题