A method for image processing, the method comprising: obtaining image data and obtaining metadata associated with the image data, wherein the metadata comprises first metadata indicative of the dynamic range of a source display and second metadata indicative of a bit depth of the image data; obtaining the dynamic range of a target display; processing the first metadata indicative of the dynamic range of the source display with the obtained dynamic range of the target display to determine a maximum available expansion for the dynamic range of the image data, the maximum available expansion applied to the image data fully exploiting the capabilities of the target display, the determining of the maximum available expansion comprising computing a ratio of the dynamic range of the target display and the dynamic range of the source display; processing the second metadata indicative of a bit depth of the image data to determine a maximum safe expansion for the dynamic range of the image data, the maximum safe expansion indicating an acceptable degree of dynamic range expansion; comparing the maximum safe expansion to the maximum available expansion; if the maximum safe expansion equals or exceeds the maximum available expansion, processing the image data to expand the dynamic range of the image data by the maximum available expansion, if the maximum safe expansion is less than the maximum available expansion, processing the image data to expand the dynamic range of the image data by the maximum safe expansion, the processing of the image data to expand the dynamic range of the image data comprising applying a tone mapping curve to the image data. obtaining image data and obtaining metadata associated with the image data, wherein the metadata comprises first metadata indicative of the dynamic range of a source display and second metadata indicative of a bit depth of the image data; obtaining the dynamic range of a target display; processing the first metadata indicative of the dynamic range of the source display with the obtained dynamic range of the target display to determine a maximum available expansion for the dynamic range of the image data, the maximum available expansion applied to the image data fully exploiting the capabilities of the target display, the determining of the maximum available expansion comprising computing a ratio of the dynamic range of the target display and the dynamic range of the source display; processing the second metadata indicative of a bit depth of the image data to determine a maximum safe expansion for the dynamic range of the image data, the maximum safe expansion indicating an acceptable degree of dynamic range expansion; comparing the maximum safe expansion to the maximum available expansion; if the maximum safe expansion equals or exceeds the maximum available expansion, processing the image data to expand the dynamic range of the image data by the maximum available expansion, if the maximum safe expansion is less than the maximum available expansion, processing the image data to expand the dynamic range of the image data by the maximum safe expansion, the processing of the image data to expand the dynamic range of the image data comprising applying a tone mapping curve to the image data.