A method for forward reshaping luma components of an input image of a first dynamic range, comprising: providing a reference tone-mapped image over a second dynamic range that corresponds to the input image of the first dynamic range, wherein the first dynamic range is greater than the second dynamic range; providing a luma forward reshaping function to forward reshape luma components of an input image of a first dynamic range into luma components of a corresponding forward reshaped image over a second dynamic range based on one or more luma mapping parameters; providing a plurality of combinations of candidate parameter values for the one or more luma mapping parameters; generating a luma histogram of the input image over the first dynamic range; generating a luma histogram of the reference tone-mapped image over the second dynamic range; generating a plurality of mapped luma histograms over the second dynamic range by converting, for each of the provided candidate parameter values for the one or more luma mapping parameters, the luma histogram of the input image over the first dynamic range via the luma forward reshaping function with a respective combination of the provided candidate parameter values to a corresponding mapped luma histogram over the second dynamic range; comparing the plurality of luma histograms over the second dynamic range with the luma histogram of the reference tone-mapped image over the second dynamic range; selecting, based on results of comparing the plurality of luma histograms with the luma histogram of the reference tone-mapped image, a specific combination of candidate parameter values from among the plurality of combinations of candidate parameter values; using the luma forward reshaping function with the one or more luma parameter values that are set to the specific combination of candidate parameter values to forward reshape luma components of the input image into luma components of the forward reshaped image over the second dynamic range; generating backward reshaping metadata that is to be used by the one or more recipient devices to generate a luma backward reshaping function that corresponds to an inverse of the luma forward reshaping function with the one or more luma parameter values set to the specific combination of candidate parameter values; and transmitting the forward reshaped image with the backward reshaping metadata to one or more recipient devices. providing a reference tone-mapped image over a second dynamic range that corresponds to the input image of the first dynamic range, wherein the first dynamic range is greater than the second dynamic range; providing a luma forward reshaping function to forward reshape luma components of an input image of a first dynamic range into luma components of a corresponding forward reshaped image over a second dynamic range based on one or more luma mapping parameters; providing a plurality of combinations of candidate parameter values for the one or more luma mapping parameters; generating a luma histogram of the input image over the first dynamic range; generating a luma histogram of the reference tone-mapped image over the second dynamic range; generating a plurality of mapped luma histograms over the second dynamic range by converting, for each of the provided candidate parameter values for the one or more luma mapping parameters, the luma histogram of the input image over the first dynamic range via the luma forward reshaping function with a respective combination of the provided candidate parameter values to a corresponding mapped luma histogram over the second dynamic range; comparing the plurality of luma histograms over the second dynamic range with the luma histogram of the reference tone-mapped image over the second dynamic range; selecting, based on results of comparing the plurality of luma histograms with the luma histogram of the reference tone-mapped image, a specific combination of candidate parameter values from among the plurality of combinations of candidate parameter values; using the luma forward reshaping function with the one or more luma parameter values that are set to the specific combination of candidate parameter values to forward reshape luma components of the input image into luma components of the forward reshaped image over the second dynamic range; generating backward reshaping metadata that is to be used by the one or more recipient devices to generate a luma backward reshaping function that corresponds to an inverse of the luma forward reshaping function with the one or more luma parameter values set to the specific combination of candidate parameter values; and transmitting the forward reshaped image with the backward reshaping metadata to one or more recipient devices.