last day (18 days later) » 

7:01 PM
6
A: GPUImage add hue/color adjustments per-RGB channel (adjust reds to be more pink or orange)

VB_overflowI made an example on ShaderToy. Use latest Chrome to see it, on my side it does not work on Firefox or IE because it uses a video as input. After some experiments it seems to me that for red hues to be more "pink" you need to decrease the hue, but to get more "orange" you need to increase satura...

 
Looks really slick! I'll spend some time today fiddling with this and see what I can make happen. Cheers!
Finally got this integrated into GPUImage, but it's not affecting the image quite like I'm trying to do. Instead of adjusting the reds between pink and orange, it's affecting them the same way it does in my q - between pink and green. Thoughts?
Ah, and for that matter, even playing around with the hue shift on shadertoy has the same effect - so I need to figure out a way of calculating a hue between pink and orange, rather than pink and green. What about finding a way to 'tint' the reds (now that we've isolated them) rather than a hue shift?
 
It seems that changing the hue of "dark reds" cause them to turn green, so I changed the answer to another technique which uses saturation in order to turn red into orange
 
Nearly there - only one problem I'm facing: rgb2hsv(colorRGB); you're passing a vec4, but the function rgb2hsv takes a vec3 as a param. Shader won't compile.
Update: rgb2hsv(colorRGB.rgb); duh! Except now it appears not to affect the image when I set the effect amount to +-0.25. Will fiddle around some more.
 
Error in the shader fixed. It may not affect your image because the part which selects the hue range to change may be too strict: please try to force weight to be 1.0, this will apply the effect to the whole image, not just to red hues. Also please try to use a bigger effect amount, like 0.5, 1.0 or even more.
 
Yup, I'll give those a shot tomorrow.
Fiddled around - no luck yet. I've posted my current iteration (including the weight forcibly set to 1.0). Maybe you can spot what I'm doing wrong?
 
7:01 PM
If I understand well what you are saying is that the image is not changin at all ... so let's do a simple test then, we will force maximum saturation everywhere, add colorHSV.y = 1.0; just before highp vec3 finalColorRGB = hsv2rgb(colorHSV.rgb); ... I am starting to think that the uniforms values would not be sent to the shader ... so they would all be zero ...
About uniforms you should check if you do it like this example : github.com/BradLarson/GPUImage/blob/…
you asolutely need to have code looking like this :
`[self setFloat:_blue forUniform:blueUniform program:filterProgram];`
if something like that is not done at least one time for each uniform then they will have a zero value in the shader ...
 
 
1 hour later…
8:05 PM
Hey - in the middle of other things at the moment, but I don't want you to lose the bounty. Will award it now, and come back as soon as I can to continue working on this. Thanks again for all your help!
 
8:48 PM
thanks for the bounty !
 
9:08 PM
Np!! Thanks so much for all your time and effort. It's the last piece of my puzzle, so kind of a big deal.
OK, so setting colorHSV.y = 1.0; does affect the image
oh, crap I missed what you said about the setters too
Going to do that soon
 

  last day (18 days later) »