BonMot icon indicating copy to clipboard operation
BonMot copied to clipboard

Update image tinting to use UIGraphicsImageRenderer where possible

Open ZevEisenberg opened this issue 6 years ago • 2 comments

UIGraphicsImageRenderer supports wide color, and UIGraphicsBeginImageContext does not. We should use the former on OSes that support it.

Questions:

  • does macOS have an equivalent image renderer?
  • We currently have a convoluted image tinting function with a lot of conditional compilation. Can we imrprove this situation? Will we need to, in order to add a third or possibly fourth permutation of how we render?

ZevEisenberg avatar Jun 13 '18 12:06 ZevEisenberg

Hi,

I've actually been using your library for a while now. Great work btw.

I came across this Issue and thought you might be interested in my port: https://github.com/shaps80/GraphicsRenderer

It's backward compatible & supports macOS. I don't think I've updated it to support wide colour, but that shouldn't be a huge task. Its also been designed to map the APIs directly, I was originally using it and then just dropping the prefix once I no longer needed it.

Anyway, maybe it's useful as a starting point.

shaps80 avatar Jun 29 '18 14:06 shaps80

@shaps80 thanks for sharing! I'll check it out if/when I get around to implementing this change.

ZevEisenberg avatar Jul 01 '18 03:07 ZevEisenberg