3
votes

I fail to understand the input parameters of the CIFilter named CITemperatureAndTint. The documentation says it has two input parameters which are both a 2D CIVector.

I played with this filter a lot - via actual code, via Core Image Fun House (example project from Apple - "FunHouse") and via iPhoto.

My intuition says that this filter should have two scalar input parameters: One for the temperature and one for the tint. If you look at the UI of iPhoto you see this:

Screenshot of iPhotos Temperature and Tint UI:

Screenshot of iPhotos Temperature and Tint UI

As expected: One slider for the temperature and one for the hue. How did apple "bind" the value of each slider to a 2D-Vector? akaru asked this question already but got no answer: What's up with CITemperatureAndTint having vector inputs?

2
Could you please upload the image using Ctrl+G? - kennytm
I have not enough reputation to do this. - Christian Kienle

2 Answers

9
votes

I have opened a technical support incident at Apple and asked them the same question. Here is the answer from the Apple engineer:

CITemperatureAndTint has three input parameters: Image, Neutral and TargetNeutral. Neutral and TargetNeutral are of 2D CIVector type, and in both of them, note that the first dimension refers to Temperature and the second dimension refers to Tint. What the CITemperatureAndTint filter basically does is computing a matrix that adapts RGB values from the source white point defined by Neutral (srcTemperature, srcTint) to the target white point defined by TargetNeutral (dstTemperature, dstTint), and then applying this matrix on the input image (using the CIColorMatrix filter). If Neutral and TargetNeutral are of the same values, then the image will not change after applying this filter. I don't know the implementation details about iPhoto, but I think the two slide bars give the Temperature and Tint changes (i.e. differences between source and target Temperature and Tint values already) that you want to add to the source image.

Now I have to get my head around this answer but it seems to be a very good response from Apple.

1
votes

They should be 2D vectors containing the color temperature. The default of (6500, 0) will leave the color unchanged, as described here. You can see what values for color temperature give you which colors in this wikipedia link. I'm not sure what the 2nd element of the vector is for.