Processing changes the colors in the loaded image

I am finding that just loading an image in Processing and then saving the image changes the colors in the image. I am not doing any changes to the image. Simply loading and saving. However, I can see a slight difference in the colors. The source image has more ‘redness’ than the saved image. I expected them to be identical.

It is important that Processing maintains the original colors of the image, and therefore is a problem. I have attached the source image. Attaching a tif file is not allowed, so you might have to run the program to see the difference in colors. It is a slight difference only but the difference does exist.

Is it a bug in either the loadImage function or save function ? How can this be resolved ?

This is the code:

PImage img_edited;


void setup()
{
      noLoop();
}

void draw() 
{
  img_edited = loadImage("target/source_img.png");
  img_edited.save("img_tmp"+".tif");
}
1 Like

Hi @apac,

Can you provide a download link to the original image? (you can use privacy friendly drop service like: https://drop.chapril.org/)

We can then reproduce the issue on our own.