Issues with modified ofImage color for jpeg images

Having some issues with using ofImage and it modifying image quality ? The first image shown below is a screen grab of a .jpeg image file as displayed using Preview on a Mac
.
Preview

This second image is a screen grab of that same jpeg file when loaded and drawn in a simple openFramworks project.

ofImage

The file is defined as an ofImage object using ofImage name;
Loaded using name.load;
Displayed using name.draw(xPos, yPos);

It couldn’t be simpler and it is displayed at the correct size and position but the color is muted and this happens with multiple jpeg images.

I have been away from openFrameworks for a while but I’ve not encountered this on earlier projects and expect it is something simple but it is so simple, I can’t identify the problem??

Any suggestions will be appreciated.

Can you try adding:

ofSetColor(255, 255, 255, 255);
before the ofImage::draw call .

Also if the image has alpha or transparency it might draw differently between Preview and OF.
A good way to see if that is the case is set the OF background to white.

void ofApp::draw(){
ofBackground(255, 255, 255); // make the background color white. 

Hope that helps!
Theo

I was just in the process of removing this post - since in the past 5 minutes I realized that I had changed ofSetColor prior to displaying the image and that was the problem…

This Forum is a great asset and I appreciate your time in offering this advice!!

1 Like