Logitech webcam pink/purple color

hi there,

I just connected 2 logitech camera’s to my computer (webcam, logitch quickcam chat) but the color of the frames I grab is a bit pink / purple…
I tested this on another computer and it worked fine.

Does someone knows more about this?

Ahh… found it… I used ofSetColor()… <---- is this a bug in of?

#include "CamInput.h"  
CamInput::CamInput(std::string sID, int iDeviceID, int iWidth, int iHeight) {  
	cout << "Created CamInput: " << sID << "\n";  
    _miWidth = iWidth;  
    _miHeight = iHeight;  
    // Load the font from the data directory  
std::string CamInput::GetID() {  
    return _msID;  
void CamInput::SetID(std::string sID) {  
    _msID = sID;  
bool CamInput::SaveFrameToFile(std::string sFile) {  
    std::cout << "Saving to a file: " << sFile << "\n";  
	unsigned char* p_bytes = GetPixels();  
	ofImage o_image;  
	o_image.setFromPixels(p_bytes, _miWidth, _miHeight,OF_IMAGE_COLOR, true);  
	std::cout << "@ Saved file: " << sFile << "\n";  
    return true;  
void CamInput::Update() {  
void CamInput::Draw(int iX, int iY) {  
	_mGrabber.draw(iX, iY);  
	float f_height = _mIDFont.stringHeight(GetID().c_str());  
	_mIDFont.drawString(GetID().c_str(), iX + 10, iY + _miHeight +f_height+5);  
void CamInput::GrabFrame() {  
unsigned char * CamInput::GetPixels() {  
	return _mGrabber.getPixels();  

ofSetColor()… <---- is this a bug in of?

no, this is a feature :slight_smile:

when you draw a texture current draw color tints the texture. since the videoGrabber, videoPlayer, etc have texture internally, the color you use before you draw them effects them. just set the color ofSetColor(255,255,255) before you draw the object / item and you’ll be fine.

take care!