[Qt-interest] pc vs mac color differences (gamma correctingqcolor?)

Ross Bencina rossb-lists at audiomulch.com
Fri Jun 19 08:55:48 CEST 2009


Hello Nathan

Thanks for responding. It's a good question.

I am not sure that my gamma correction approach is correct -- as you say, 
it's quite possible that something other than a simple gamma shift is 
causing the colors to appear differently, but that would be my first guess. 
I'm wondering if anyone here has a better idea of what to do to get as close 
as possible to matching colours on Mac and Windows in Qt (assuming default 
colour settings on both systems).

Thanks

Ross.

===================================
AudioMulch 2.0 is here!

http://www.audiomulch.com
----- Original Message ----- 
From: "Nathan Carter" <nathancarter5 at gmail.com>
To: "qt-interest List" <qt-interest at trolltech.com>
Sent: Friday, June 19, 2009 2:44 AM
Subject: Re: [Qt-interest] pc vs mac color differences (gamma 
correctingqcolor?)


>
> Dear Ross,
>
> Are you sure that the difference can be fixed using gamma correction?
> If so, how did you become sure of that?  And if so, is the source of
> your certainty due to some docs which gave you the 1.8 vs. 2.2
> difference?  I see these two numbers mentioned on the Wikipedia
> article under gamma correction, but that seems to be specific to image
> files.
>
> Your math seems correct to me, if your goal is to take a number
> a^(2.2/1.8) and convert it back to the original a.  (In that case,
> raising it to the 1.8/2.2 power is exactly the right thing to do,
> modulo roundoff issues.)  But are you certain that this is the
> operation that will solve your problem?  It seems not, given that it's
> not doing so.
>
> So I guess I'm suggesting that you find out what's causing the
> difference; did you just assume that it's a gamma-correction issue?
> Am I helping at all?
>
> Nathan
>
>
> On Jun 18, 2009, at 3:42 AM, Ross Bencina wrote:
>
>> Hi Guys
>>
>> I run Windows and OSX on the same computer using BootCamp. On each
>> OS, on
>> exactly the same screen, colours displayed in my Qt app look
>> different. This
>> is a problem since I have invested in having a custom colour scheme
>> designed
>> for my app and I would like it to look just as good on both platforms.
>>
>> I have experimented with gamma correcting each QColor in my QPalette
>> but it
>> doesn't seem to work very well -- possibly because my gamma
>> correction code
>> is wrong (see below for interest).
>>
>> Has anyone solved this problem? Do you have any suggestions about
>> how to
>> approach it?
>>
>> /// try to convert a QColor which looks correct on PC to something
>> which
>> looks correct on OSX
>> /// (not working very well)
>> static QColor pcColor( int rr, int gg, int bb, int aa=255 )
>> {
>> QColor c(rr,gg,bb,aa);
>> static const double m = 1.8/2.2;
>> qreal r = std::pow( c.redF(), m );
>> qreal g = std::pow( c.greenF(), m );
>> qreal b = std::pow( c.blueF(), m );
>>
>> return QColor::fromRgbF( r, g, b, c.alphaF() );
>> }
>>
>>
>>
>> Thanks!
>>
>> Ross.
>>
>> _______________________________________________
>> Qt-interest mailing list
>> Qt-interest at trolltech.com
>> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest 




More information about the Qt-interest-old mailing list