A pixel pre-processing comprises obtaining an original linear luminance component value of a pixel in a picture in a third color space determined based on a linear color of the pixel in a first color space. A non-linear luma component value in a second color space is derived for the pixel based on a first non-linear chroma component value in the second color space, a second non-linear chroma component value in the second color space and the original linear luminance component value in the third color space. The pre-processing reduces luminance artifacts that otherwise may occur when chroma subsampling is used in combination with a non-linear transfer function.