If we shift the hue by 2*pi/3, what will the R, G, B, histograms change?
How can I test this? I have access to photoshop, so is there a way to test this and find the answer?
If we shift the hue by 2*pi/3, what will the R, G, B, histograms change?
How can I test this? I have access to photoshop, so is there a way to test this and find the answer?
3
Answers
I do not think there is an generic answer to this as the result is dependent on the image colors present not just on R,G,B histograms. You need to:
I do not use photoshop but I think #1,#2,#4,#5 should be present there. the #3 should be there too (in some filter that manipulates brithness, gama etc) but hard to say if adding to hue will be clamped by only limiting angle or it will handle it as periodic value. In the first case you need to correct the results by:
add A.hue+=pi/3 and **B.hue-=2*pi/3
the
A
holds un-clamped colors andB
the colors that were clamped inA
shifted to the correct hue posititon.in A recolor all pixels with hue==pi2 with some specified color
the
pi2
should be the value your tool clamped hues above pi2 so it can be zero, pi2 or one step less then pi2. This will allow as to ignore clamped values later.merge the A,B histograms
simply add the graph values together.
And now you can compare the histograms to evaluate the change on some sample images.
Anyway you can do all this in any programing language. For example most of the operations needed are present in most image processing and computer vision libs like OpenCV and adding to hue are just 2 nested
for
loops addition and singleif
statement like:of coarse most HSV pixel formats I used does not use floating values so the hue could be represented for example by 8 bit unsigned integer in which case the code would look like:
If you need to implement the RGB/HSV conversions look here:
I think this might interests you:
Looking at it from a mathematical point of view 2×pi/3 with pi = 3.14 you have 2×pi which is the the “scope” of a circle.
Devided by 3 that means you have a third of a circle or simply 120°
According to HSV into RGB conversion formula (part of it):
Shifting HUE by 120° will swap channel histograms:
To test this in GIMP,- open image histogram in
Colors Info Histogram
.Choose Red,Green or Blue channel to see it’s histogram and then open dialog
Colors Hue-Saturation
and then adjust Hue by +- 120 degrees and see live effect in Histogram window.