A computer-implemented method for high dynamic range, HDR, image processing, the computer-implemented method comprising: receiving a set of input images, wherein each input image in the set of input images has a respective HDR merge weight; determining, based on the set of images, one or more moving components , each having a boundary isolating a region where motion is present; selecting, for each moving component of the one or more moving components , one or more reference images from the set of input images, wherein the one or more reference images are independently selected for each moving component ; determining a respective ghost-optimized merge weight for each of one or more reference images in order to reduce or eliminate motion artifacts; creating an HDR output image by merging the set of input images, wherein the merging uses the respective HDR merge weight for pixels outside the boundary of each moving component and uses the respective ghost-optimized merge weight instead of the respective HDR merge weight for pixels inside the boundary of a respective moving component ; characterized by creating an artifact-free output image by matching one or both of chroma and illumination of each reference image to one or both of chroma and illumination of the HDR output image, wherein matching further comprises: creating at least one difference image associated with a respective reference image by calculating the pixel-wise difference between the reference image and the HDR output image; creating an offset image by blurring the difference image; and adding the offset image to the respective reference image to produce a corrected reference image, and providing the corrected reference image as input for a linear combination of images to create the artifact-free output image. receiving a set of input images, wherein each input image in the set of input images has a respective HDR merge weight; determining, based on the set of images, one or more moving components , each having a boundary isolating a region where motion is present; selecting, for each moving component of the one or more moving components , one or more reference images from the set of input images, wherein the one or more reference images are independently selected for each moving component ; determining a respective ghost-optimized merge weight for each of one or more reference images in order to reduce or eliminate motion artifacts; creating an HDR output image by merging the set of input images, wherein the merging uses the respective HDR merge weight for pixels outside the boundary of each moving component and uses the respective ghost-optimized merge weight instead of the respective HDR merge weight for pixels inside the boundary of a respective moving component ; characterized by creating an artifact-free output image by matching one or both of chroma and illumination of each reference image to one or both of chroma and illumination of the HDR output image, wherein matching further comprises: creating at least one difference image associated with a respective reference image by calculating the pixel-wise difference between the reference image and the HDR output image; creating an offset image by blurring the difference image; and adding the offset image to the respective reference image to produce a corrected reference image, and providing the corrected reference image as input for a linear combination of images to create the artifact-free output image. creating at least one difference image associated with a respective reference image by calculating the pixel-wise difference between the reference image and the HDR output image; creating an offset image by blurring the difference image; and adding the offset image to the respective reference image to produce a corrected reference image, and providing the corrected reference image as input for a linear combination of images to create the artifact-free output image. <EOS>