Is it possible?
I have this video shot in nightvision that should be only green. I wanna get rid of any other color to increase compression. Making it grayscale destroys sat as well as hue though so colorizing to green later is useless as it doesn't look the same.
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 30 of 73
Thread
-
-
Sample? Pics?
Removing hue seems to be logically impossible since it describes the character of color. Besides, I doubt it will increase compression. The color difference channels are already squeezed down into almost nothing. -
Code:
GreyScale() ConvertToRGB() RGBAdjust(r=0, b=0)
Last edited by jagabo; 2nd Jun 2013 at 10:16.
-
If you can decode via DirectShow using ffdshow, it's Picture Properties filter might do what you're after. I tried removing red and blue first, and then I tried reducing the saturation to zero and using the Colorize function to make it "green and white". Either way could probably give you the same result in the end. The first method might force you to adjust luminance or saturation etc, while the second method lets you (also) wind in the amount of colour you want.
Ultimately though, if the only colour you want is green, I'm not sure I understand what you mean by "converting to greyscale destroys saturation".... at least not in relation to the result you're after, which to my way of thinking is effectively a black and white image converted to green and white. Could it be more a brightness/contrast problem after everything but green has been removed?
Before and After using ffdshow:
[Attachment 18158 - Click to enlarge]
[Attachment 18159 - Click to enlarge]Last edited by hello_hello; 2nd Jun 2013 at 10:28.
-
To "literally" do what you say you want to do (convert non-green to greyscale while leaving green alone), you could try Tweak. Something like this:
Tweak(sat=0, startHue=260, endHue=200)
[Attachment 18160 - Click to enlarge] -
Use VirtualDub's "Channel Mixer" filter.
Set Green Channel "0" (R = 0, G = 0, B = 0). -
What I wanna do is flatten the hue so every pixel has the same hue value. The average hue of my clip is 115 like you would see on mspaint so it's actually closer to teal than green, my bad.
Jagabo, your method flattened the saturation completely. The contrast is at its constant max.
hello_hello, that was good but I couldn't reproduce the result by playing around with ffdshow since I rarely mess with it except debanding/adding noise. Describe exactly which settings you changed. I don't see an RGB slider.
Tweak(sat=0, startHue=260, endHue=200)
-
-
With ffdshow I just enabled the Picture Properties filter and all the fun stuff is in there. I slid the saturation down to zero, clicked on the color button next to "Colorize" and picked a shade of green, then raised the slider under the Colorize section to convert the greys to greens by the appropriate amount. The saturation slider also has an effect on the amount of color.
Alternatively (use the Reset button to start again if need be) there's 3 small sliders under "RGB gamma correction". You can slide 1/R and 3/B down to zero then fiddle with luminance etc, but with only the middle slider in the default position all you should be left with is green.
It's removing everything which isn't green, so if the video is more teal you'll need to adjust the numbers a bit (or a lot as the perceived color can sometimes be deceptive). The full range is 0 to 360. Between roughly 200 and 260 is green. So you could try moving the values up or down 10 at a time etc,
For example, Tweak(sat=0, startHue=250, endHue=190)
(until the color appears), then widening or narrowing the range till all you're left with is the colour you want. With "sat=0" everything outside that range will be greyscale.
If you reverse the numbers like this:
Tweak(sat=0, startHue=200, endHue=260)
then only green becomes greyscale and everything else remains.
It's often a matter of just playing around until you get the range correct, but I'm not sure in this case it'll give you the result you're wanting. -
With ffdshow I just enabled the Picture Properties filter and all the fun stuff is in there. I slid the saturation down to zero, clicked on the color button next to "Colorize" and picked a shade of green, then raised the slider under the Colorize section to convert the greys to greens by the appropriate amount. The saturation slider also has an effect on the amount of color.
Alternatively (use the Reset button to start again if need be) there's 3 small sliders under "RGB gamma correction". You can slide 1/R and 3/B down to zero then fiddle with luminance etc, but with only the middle slider in the default position all you should be left with is green.
It's removing everything which isn't green, so if the video is more teal you'll need to adjust the numbers a bit (or a lot as the perceived color can sometimes be deceptive). The full range is 0 to 360. Between roughly 200 and 260 is green. So you could try moving the values up or down 10 at a time etc,
For example, Tweak(sat=0, startHue=250, endHue=190)
(until the color appears), then widening or narrowing the range till all you're left with is the colour you want. With "sat=0" everything outside that range will be greyscale. -
no thanks. i thought it was tipically shot footage from your cam. otherwise you could shoot something like your hand or the bathroom tub with your hand waving around the lens. my sony trv22 has a night vision feature, but i never used it. its not exactly green, i just tried it just now for the first time.
-
I'd first find out the color value you want and make a frame that color. Then greyscale everything and overlay the color you want at the opacity you want
-
I don't see a problem with posting a sample that doesn't show anything rated above PG.
What you want may not be possible. I replaced the chroma channels of a color clip with constant green and what happened is that 50% of the image converts to RGB values that are out-of-range (clipped). -
-
-
Code:
V0 = last V0.GreyScale() V1 = last V1 MergeChroma(BlankClip(last,color=color_teal)) V2 = last Interleave(V0,V1,V2)
-
The way I understand "hue" is it's a shift in colour. You can't flatten it as such. Like this:
http://en.wikipedia.org/wiki/File:Hue_shift_six_photoshop.jpg
Saturation is simply the amount of color relative to brightness, so I don't quite understand what you're after in terms of saturation. There's only one colour green in the samples I posted, which is what you said you wanted. If converting it to one colour makes the video appear dimmer or brighter over-all, then adjusting the amount of the remaining single colour (saturation), or adjusting the brightness to compensate etc, is probably something which can't be avoided.
Yes, and when combined startHue and endHue it only kills it for a specific range. That was the whole point. I think I said in my last post it's probably not what you want.
You're wanting all the non-teal colours to somehow be shifted to teal too, but for reasons I don't understand, you seem to be saying converting from "color" directly to "tealscale", would somehow produce a different result than converting from color to greyscale first, and then from greyscale to "tealscale". Maybe I'm just not fully understanding what you're wanting to do yet. -
What you want is equivalent to Duotone in Photoshop. Btw, you are mis-using the terms "Saturation" and "Hue". Saturation and Hue are like hello_hello was talking about. A grayscale image has NO sat and indeterminant hue, but a "greenscale" duotone has sat determined partly by the luminance and partly manually adjusted peak, while the hue is specifically designed to match your color needs.
But, you are also not understanding that it is very possible to go rgb -> grayscale -> duotone, particularly if you control the channel mixing.
Scott -
Hue isn't a "shift", hue is hue, just like red isn't blue. Open a photo with MSPaint, sample a pixel and go to properties to view its Hue/Sat/Lum and R/G/B. Hue is a number from 0-240 where 0 is pure red, 40 is pure yellow, 80 is pure green, 120 is pure cyan, 160 is pure blue and 200 is pure purple. Pure orange would be 20, between red and yellow. Human skin is about 15, and changing the brightness will change it from caucasian to african but the hue remains the same.
That picture on wikipedia shows a global shift of hue values. Adding 40 will make red yellow and blue purple, but for both to be yellow, blues would have to be deducted by a lot and reds would only need to be added to a little. That's what flattening would be but I can't find a tool to do so, not one that doesn't also mess with the sat/luma.
Saturation is simply the amount of color relative to brightness, so I don't quite understand what you're after in terms of saturation. There's only one colour green in the samples I posted, which is what you said you wanted. If converting it to one colour makes the video appear dimmer or brighter over-all, then adjusting the amount of the remaining single colour (saturation), or adjusting the brightness to compensate etc, is probably something which can't be avoided. -
I agree. What the others are getting confused about is the way the hue control works in most programs -- it's a rotation through the U and V planes. What you are asking for is a a fixed hue without changing value or saturation (I didn't understand that in your original post, and I don't think it's really what you want). I don't know of any AviSynth filter that does that. I wonder if there's a way you could rotate the hue, crush the U or V plane, then rotate the hue back.
Last edited by jagabo; 2nd Jun 2013 at 20:05.
-
-
Do want to limit the hue range (ie. a "narrow" hue range) , but keep S=saturation and V=value (brightness or lightness) the same as original ?
Most video type programs don't work in HSV , they work in RGB or YUV .
(note: HSV is also called HSL or HSB , L= lightness, B=brightness ; but it's basically the same color model)
If so, what you would do is pick a hue value from a solid color (e.g. 162 degrees), and replace the H channel from the original . I don't know if avisynth or vdub can do this, but you could do this in something like after effects -
The rotate(chroma), crush(U or V), unrorate(chroma) sequence basically works -- except the result has positive and "negative" hues. The negative hues need to be inverted.
Original image:
After Tweak(hue=-45).ColorYUV(cont_u=-256).Tweak(hue=45):
As you can see, the problem is the end of the line in the UV plot that extends to the top left. It needs to be inverted to go to the bottom right, turning all the purples green. You can use different rotation angles to get different shades.Last edited by jagabo; 2nd Jun 2013 at 20:45.
-
Do want to limit the hue range (ie. a "narrow" hue range) , but keep S=saturation and V=value (brightness or lightness) the same as original ?
jagabo,
Can you expound on your script? Why -45 hue then back? Why then increase the blue contrast (positive U is blue right?) by max?
Also, how do you generate all those graphic analyses? -
The waveform and vectorscope graphs were made with VideoScope():
Code:VideoScope("both", true, "U", "V", "UV")
Tweak(hue=-45) rotates the colors -45 degrees. If you were to look at the UV plot at that point you would see a counter clockwise rotation of 45 degrees. This is in preparation for the next step.
ColorYUV(cont_u=-256) reduces the contrast of U (eliminates the U saturation), reducing the UV plot to a vertical line from cyans to reds.
Tweak(hue=45) rotates colors back to where they started. The UV plot is now a straight line from the lower left to the upper right. Anything that was predominantly green is now green. Anything that was predominantly blue or red is now purple. You can see this in the color bars. The yellow, cyan, and green bars have become green, all with the same hue. The purple, red, and blue bars have become purple, all with the same hue.
This isn't the same thing as setting all hues of the original to a fixed value (even if you reflect the purples to greens). Some colors still lose saturation (flesh tones, for example). You can adjust for that by rotating by different angles). I believe the way round this is to add in colors rotated in the other directly and similarly crushed and working with squared values (think Pythagoras). But at this point it's probably easier to just write your own filter that sets a fixed hue. Convert YUV to HSV, fix H, convert HSV to YUV. -
The first one is the right idea but I still see varying hue at the top of the screenshot.
Btw, the pic of the hottie looks so depressing right now in that color. Looks like something out of Gothika.
Jagabo, thanks for all the info. Are these videoscope graphs what people use as a guide for contrast/color correction?
Similar Threads
-
Strange Hue problem
By dan59 in forum CapturingReplies: 26Last Post: 16th Nov 2012, 02:41 -
How to adjust Hue of vob file ?
By vidyarathne in forum Newbie / General discussionsReplies: 3Last Post: 11th Sep 2012, 14:07 -
Hauppauge PVR-150 Hue and Saturation adjustment
By Spektre in forum CapturingReplies: 3Last Post: 15th Jun 2011, 10:09 -
Pink hue on TV
By uniks in forum Newbie / General discussionsReplies: 4Last Post: 5th Apr 2011, 06:00 -
fluctuation of saturation and hue levels
By mark23 in forum RestorationReplies: 0Last Post: 1st Feb 2011, 17:12