1
import cv2;
input_path = 'input.JPG';
output_path = 'output.jpg';
input_image = cv2.imread(input_path,cv2.IMREAD_UNCHANGED)
cv2.imwrite(output_path,input_image)

Check the input output image comparision here

This is the original image - https://i.stack.imgur.com/LPoES.jpg

There is a color change between input and output image. Please help me modify the code so the input and output images are exactly matching. Thanks!

  • Possible duplicate of [OpenCV imwrite gives washed-out result for jpeg images](https://stackoverflow.com/questions/33142786/opencv-imwrite-gives-washed-out-result-for-jpeg-images) Check the comments below the question. I can reproduce the statement like _Opening your first [...] image, GIMP tells me that it has `Adobe RGB (1998)` color profile._ So, this is most likely your problem. – HansHirse May 14 '19 at 07:19

1 Answers1

0

The image is in AdobeRGB format. That is the issue. We are using GIMP to convert into SRGB and then using it in our sfotware. It is working fine now.