When dealing with digital images in different contexts the ICC profile file format has proven to be the best choice. It allows to transform images to different color spaces like RGB or CMYK while retaining the original look as good as possible.
Of course, color management can still be a difficult task but lookup tables or other simple approaches are simply not capable enough.
If you’re intested in an introduction to ICC profiles Wikipedia has a short article.
The latest specifications can be found on the web site of the International Color Consortium.
On macOS there’s a built-in tool that displays color profiles:
However, if you want to see all the details of ICC profiles, there’s a grammar for Synalyze It! (macOS) and Hexinator (Linux and Windows). You can download the grammar from the Synalyze It! web site or directly within these applications.
The header structure of ICC profiles contains informations about the color spaces, creator and manufacturer of the profile and other specifics. Following the header many tag structures define the specifics like media white point and color conversions.