Since 2016, new Apple products (like the iPhone 7) use the P3 color space instead of the sRGB color space. Therefore I'm interesting in measuring the practical impact on some pictures I have shot.
Given a JPEG file, how can I check if it contains any pixels that are not within sRGB? And how can I mark them, e.g. turn them pink or yellow? (Or almost equivalently: How can I check if conversion to sRGB has any destructive impact on an image?)
For example, on www.astramael.com, there are various examples of images that are representable with Adobe RGB or sRGB, but cannot be accurately represented using sRGB. If you scroll a bit down, you see a picture where all non-sRGB-pixels have been replaced with light red pixels, in order to make the difference visible. How is it possible to create such an image? Which tools can be used for that?
My motivation is that I want to check the impact of a color space that is different from sRGB. I don't doubt that there are real colors that are not-in-sRGB. But are there any colors out-of-sRGB in any of the pictures that I shot with my iPhone 7? How common are out-of-sRGB-colors really?
Update: It would be nice to have a freeware or opensource tool for that. I don't want to install Adobe Photoshop or a similar heavyweight application. In fact a 300KB-sized command line tool could solve the problem. I'm an iOS- and macOS-developer, so it would be fine if the program works on that platform too (this includes being installable by following the standard install instructions found in the docs.) For me, it would (probably) be an option to write such a program on my own; but I hoped that someone did it already.