How is value for "Original Temperature" determined?

Color temperature is a property of the light that illuminated the subject (I looked that up). Once the image is captured by a particular sensor, the light’s color temperature is expressed as the ratios of the red, green and blue channels in the depiction of the color white (this is my conclusion, anyone feel free to correct me). So, the problem becomes aligning the individual channels so they make white do this: R=G=B.

In the olden days (my grandkids have told me anything earlier than 2008 are the olden days), color film emulsions were crafted to respond to the color temperature of light to make white R=G=B. Digital cameras have both that and the green bias of the CFA to worry, and the multipliers in the metadata correct for both.

So, bear-of-little-brain here thinks that messing with white balance using the channel multipliers directly makes more intuitive sense than using a color temperature slider to produce the multipliers. A color temperature slider on the camera, used to change the sensor response based on the actual light on the scene at the time of capture, would make more sense to me but it’s probably simpler to just hard-code the camera to one response and fiddle with the multipliers after the fact.

As always, FWIW…

Back to the original question, “How is the value for Original Temperature calculated?”

I’m not aware of a way to calculate it if you’re working with a non-raw file.

A test.

Here is a raw photo in RawTherapee, the white balance temperature is too high at 7600K, making the whole image too orange:

I saved the too-warm image as a 16-bit PNG file for later use:

I use the white balance picker to make the paper in the background neutral, which sets the temperature to 4500K:

Now open the too-warm PNG file in GIMP. Ideally GIMP would also have a pipette allowing you to pick a spot on the image which should be neutral, to calculate the optimal temp and tint for you, but GIMP 2.10.4 doesn’t have that yet, so you have to adjust the temperature manually.

GIMP does not know the original color temperature (how could it), so it sets both original and intended temperatures to a reasonable 6500K:

We know from RawTherapee that the correct temperature to balance the whites is 4500K. If you adjust the intended temperature in GIMP to 4500K, you get this:


The image still has an orange/yellow tint, because the source temperature is incorrect.

If you adjust the intended temperature visually to taste, you may arrive at 4000K which gives you this:


That is the best I could do, acting like I don’t know the source temperature. Note that the paper is close to neutral, but the rest of the photo still has a tint (the red flower is a dirty orange-red), and it does not match the correct 4500K image from RawTherapee.

If I set the intended temperature any less than 4000K it would make things even worse - the red flower is now less orange, closer to red but still “dirty”, and the paper has now turned bluish:

We cannot properly correct the white balance through setting the intended temperature without knowing the original temperature.

I was under the impression that if I set the original temperature to 7600K, which we know to be correct as that is what I set when I saved the image in RawTherapee, then setting the intended temperature to 4500K would result in an image identical to the 4500K one from RawTherapee, but it did not (compare this to the second RawTherapee screenshot):

3 Likes

More puzzles, this time in RawTherapee.

When you open the PNG in RawTherapee, it shows the temperature as 6490K and tint as 1.002 - why the 10K and 0.002 differences?

When I set the image’s original temperature to 6490K in GIMP and set the desired temperature to 4000K, the result is nothing like if I open the PNG in RawTherapee where the temperature defaults to 6490K and then set the temperature to 4000K:

1 Like

Should I convert to Fahrenheit? :stuck_out_tongue_closed_eyes:

Don’t think so.
6490K equals 11222.33 deg F.
Centigrade (Celsius) sounds a trifle better, since 6490K equals 6216.85 deg C,
at least that’s what Dr. Google has to say.

Have fun!
Claes in Lund, Sweden

I did similar experiments and didn’t come with a satisfactory answer. That is why I answered the way I did. Hope @ajax got what he wanted. :slight_smile:

@Claes I use Celsius.

I was loosely referring to
http://edition.cnn.com/TECH/space/9909/30/mars.metric.02/

Yes, and also the camera’s particular spectral response, I’d surmise.

Post-processing tools like Color Temperature and Exposure are actually “compensations”, attempting to deal post-priori with phenomenon relevant to the moment of image capture. And I think, as @Morgan_Hardwood’s experiment suggests to me, using a post-processing Color Temperature tool that doesn’t start with good information on the original light and sensor characteristics is really just an arbitrary color manipulation tool.

Edit: Okay, maybe a little heavy-handed coming from a neophyte like me, but I am interested in what more knowledgeable folk think about it. It’s all about learning…

Yes, IIRC the temperature and tint depend on the camera input profile.

Well now, when I posted my question I was thinking the answer might be simple. Little did I know that such an extensive lesson in photo editing would unfold. While I’m most grateful for the lesson and still have a good bit of reading left to do in order to complete it one take-away of mine is that Morgan got to the simple answer when he said, “I’m not aware of a way to calculate it if you’re working with a non-raw file.”. When composing my question I was hoping that “determined” might be even simpler than “calculated” but calculate would do. Unfortunately it looks like it is lost. Although, another take-away is that this doesn’t seem to bother you more experienced photographers and I need to be trying to join you.

Morgan’s test was very thorough and certainly beats anything I’d done in the way of an actual experiment. However, his mind seemed to be exactly where mine was when thinking there could (maybe should) be a more positive answer that fit with the new GIMP CT Tool. In that, there is a known value for CT when the raw file is developed and, like I suspected, this is what GIMP was meaning by “Original Temperature”. I was also thinking that maybe it would be worthwhile for me to keep track of that value (degrees kelvin) for the raw files that I develop. However, I think Morgan’s test also demonstrates that a CT value is not sufficiently precise to be transferable from one editing program to another. While it still seems like preserving this “As Developed” CT value could be of some use, at least as much as a lot of other metadata that is being kept, there are limits to how useful it might be.

Many thanks to all for your willingness to engage. I hope my question did not create too big a distraction from other things you might rather have done. I now have some more topics on my study list which need attention.

Your question was timely in my case; I’m writing a white balance tool for my software and was wrestling with what was pertinent and what was not.

What I’m gearing up to do is to write a “mechanic’s tutorial” on raw processing, starting with the really raw data array and stepping through the operations needed to get a basic usable image. The similar G’MIC tutorial that uses dcraw and the gmic command line tool were invaluable to me in learning this, my thought is to step through screen shots of my hack software that will provide both a sequential depiction of tools and the respective histograms. Some of what will be illustrated is very material to the question we’ve just discussed here, and may provide perspective for your other questions.

1 Like

!

That is exactly what I’ve been gearing up to do over the last few weeks - a workflow from the moment the photon hits the sensor till you have a ready image. I read something along those lines some years ago, IIRC it was about demosaicing etc a raw file using ImageJ - have you seen that article? I specifically want to focus on the color aspect of it, as that part is still a mystery to me, I only know parts, and it would be nice to lay out what happens to color during the whole process.

Would you be interested in collaborating on this, perhaps writing it in this wiki-forum?

3 Likes

Sounds like something I’d be very interested in reading/studying. How are we students to find it when it’s ready?

I’d love for this to be an article on the main pixls.us!

I made a critical mistake last night, ubuntu prompted “upgrade to 18.04?” and I said yes…

Once I get that all sorted out, I’ll proceed…

Did Ubuntu social engineer the consent? :rofl: I click on YES out of habit to my detriment.

@Morgan_Hardwood, I would definitely be interested. I’ll send a PM so we don’t clutter the thread.

I have it all sorted out, but not before I inadvertently wiped my home directory :frowning: Lesson learned: don’t multitask during OS upgrades. That, and Wayland way-laid me…

Not a great loss, most of my important files are on my Windows tablet. Will have to re-calibrate my display, lost that profile, but actually starting to build rawproc from scratch turned out to be beneficial in that I found almost all of the prerequisite libraries in their current versions in the distro. I only had to compile wxWidgets 3.1.1.

Oh, back to color temperature… sorry.

@ggbutcher , @Morgan_Hardwood - probably these are far too basic and simplified for what you are planning to write. But if you haven’t seen these two articles, maybe they might be helpful:

https://ninedegreesbelow.com/photography/dcraw-float-c-code.html

https://ninedegreesbelow.com/photography/dcraw-c-code-annotated.html
(actually this page just provides a link at the bottom to the actual article, which I’m trying to hide from google’s search engine).

I’ve spent hours poring over the dcraw-float-c-code article. It’s where I developed my first understanding of color management. Now, if I could only tease the semantics out of wavelet_denoise…

I did a “stream of consciousness” dump of what I have in mind here:

http://glenn.pulpitrock.net/Individual_Pictures/raw_processing/

Needs considerable work, first off to replace the blackwhitepoint part at the end with a curve that would graphically illustrate the task. My OCD sidetracked me into the Raspberry Pi thing, but I’m going to commence working it as fall cools the air…