I bet there's a way to accomplish what you're looking for with ICC profiles. They allow arbitrary functions and LUTs in addition to standard matrix math. There's typically a way to set this for your OS, an individual image, and I'm pretty sure an individual app as well (but I'd imagine only your own).
Edit: Actually, this may not be editable on iOS, but it is on macOS, Windows, probably Linux, and it looks like Android too.
Edit: Actually, this may not be editable on iOS, but it is on macOS, Windows, probably Linux, and it looks like Android too.
https://en.wikipedia.org/wiki/ICC_profile