Medina24:
Generate a 3D LUT from ProPhoto RGB primaries to the profile obtained in step 1.
I've been digging more into the maths behind this and stumbled upon an interesting question: which are the ProPhoto RGB primaries to use for 3D LUT generation?
Initially I've been naively using the ones from Wikipedia: Red 0.734699 0.265301, Green 0.159597 0.840403, Blue 0.036598 0.000105. But I know believe this to be a mistake as these primaries are relative to D50 and my 3D LUT generation uses D65. They would need to be multiplied with the chromatic adaptation matrix.