A machine-implemented method for image processing, the machine-implemented method comprising: receiving a plurality of unique input images (401, 402); creating an HDR image based on a merging of the plurality of unique input images (401,402); generating a motion mask for the plurality of unique input images, wherein the motion mask comprises a plurality of components (420, 430), wherein a component defines an area of an image where motion is present (440; 435); for each of the plurality of components: determining an image quality score from a plurality of criteria, wherein the plurality of criteria comprises exposure, color, saturation, sharpness and/or texture, for each of a plurality of unique input images; selecting a reference image from the plurality of unique input images (401, 402) based on the image quality score, wherein selecting a reference image based on the image quality score comprises using a cost function with one or more of embedded exposure, color, saturation, sharpness and/or texture criteria, and wherein selecting a reference image further comprises selecting the reference image with the highest image quality score; matching a chroma and an illumination of the reference image to the HDR image to form a corrected reference image, wherein matching the chroma and the illumination of the reference image to form the corrected reference image comprises determining a difference between the reference image and the HDR output image to form a difference image, blurring the difference image, and adding the blurred difference image to the reference image to form the corrected reference image; and creating a final HDR output image with the HDR image and the corrected reference image for each of the plurality of components by replacing the each of the plurality of components in the HDR image with the each of the plurality of components from the corrected reference image for the each of the plurality of components. receiving a plurality of unique input images (401, 402); creating an HDR image based on a merging of the plurality of unique input images (401,402); generating a motion mask for the plurality of unique input images, wherein the motion mask comprises a plurality of components (420, 430), wherein a component defines an area of an image where motion is present (440; 435); for each of the plurality of components: determining an image quality score from a plurality of criteria, wherein the plurality of criteria comprises exposure, color, saturation, sharpness and/or texture, for each of a plurality of unique input images; selecting a reference image from the plurality of unique input images (401, 402) based on the image quality score, wherein selecting a reference image based on the image quality score comprises using a cost function with one or more of embedded exposure, color, saturation, sharpness and/or texture criteria, and wherein selecting a reference image further comprises selecting the reference image with the highest image quality score; matching a chroma and an illumination of the reference image to the HDR image to form a corrected reference image, wherein matching the chroma and the illumination of the reference image to form the corrected reference image comprises determining a difference between the reference image and the HDR output image to form a difference image, blurring the difference image, and adding the blurred difference image to the reference image to form the corrected reference image; and determining an image quality score from a plurality of criteria, wherein the plurality of criteria comprises exposure, color, saturation, sharpness and/or texture, for each of a plurality of unique input images; selecting a reference image from the plurality of unique input images (401, 402) based on the image quality score, wherein selecting a reference image based on the image quality score comprises using a cost function with one or more of embedded exposure, color, saturation, sharpness and/or texture criteria, and wherein selecting a reference image further comprises selecting the reference image with the highest image quality score; matching a chroma and an illumination of the reference image to the HDR image to form a corrected reference image, wherein matching the chroma and the illumination of the reference image to form the corrected reference image comprises determining a difference between the reference image and the HDR output image to form a difference image, blurring the difference image, and adding the blurred difference image to the reference image to form the corrected reference image; and creating a final HDR output image with the HDR image and the corrected reference image for each of the plurality of components by replacing the each of the plurality of components in the HDR image with the each of the plurality of components from the corrected reference image for the each of the plurality of components.