VideoHelp Forum
+ Reply to Thread
Page 1 of 3
1 2 3 LastLast
Results 1 to 30 of 73
Thread
  1. 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.
    Quote Quote  
  2. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    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.
    Quote Quote  
  3. Code:
    GreyScale()
    ConvertToRGB()
    RGBAdjust(r=0, b=0)
    Skip the Grayscale step if you don't want R and B components to contribute to final green intensity. Convert back to YUV if necessary.
    Last edited by jagabo; 2nd Jun 2013 at 10:16.
    Quote Quote  
  4. 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:

    Image
    [Attachment 18158 - Click to enlarge]


    Image
    [Attachment 18159 - Click to enlarge]
    Last edited by hello_hello; 2nd Jun 2013 at 10:28.
    Quote Quote  
  5. 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)

    Image
    [Attachment 18160 - Click to enlarge]
    Quote Quote  
  6. Member
    Join Date
    May 2013
    Location
    Turkey
    Search PM
    Use VirtualDub's "Channel Mixer" filter.

    Set Green Channel "0" (R = 0, G = 0, B = 0).
    Quote Quote  
  7. 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)
    This just converts to gray for me.

    Use VirtualDub's "Channel Mixer" filter.

    Set Green Channel "0" (R = 0, G = 0, B = 0).
    I did that and it made it purple.
    Quote Quote  
  8. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    please post a frame or two..geesh!
    Quote Quote  
  9. Originally Posted by vhelp View Post
    please post a frame or two..geesh!
    The clip is porn. Let me know if you still want it. If so, should I find a non-kinky frame?
    Quote Quote  
  10. Originally Posted by Mephesto View Post
    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.
    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.

    Originally Posted by Mephesto View Post
    Tweak(sat=0, startHue=260, endHue=200)
    This just converts to gray for me.
    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.
    Quote Quote  
  11. 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.
    I see. I'm looking to flatten the hue to a fixed value, nothing more. I don't want the saturation messed with.

    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.
    I don't want everything not-teal to be gray but become teal too. the sat=0 kills color by default.
    Quote Quote  
  12. Member vhelp's Avatar
    Join Date
    Mar 2001
    Location
    New York
    Search Comp PM
    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.
    Quote Quote  
  13. It is typically shot footage, just not from my cam.
    Quote Quote  
  14. 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
    Quote Quote  
  15. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    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).
    Quote Quote  
  16. Originally Posted by manono View Post
    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
    Won't work because this will still **** with the sat and luma which I want untouched. I only need the hue flattened to one value.
    Quote Quote  
  17. Originally Posted by Mephesto View Post
    Won't work because this will still **** with the sat and luma which I want untouched. I only need the hue flattened to one value.
    OK, then a picture is worth a thousand words (and a piece of the video even more). Just find 5 seconds of clean material to upload.
    Quote Quote  
  18. Formerly 'vaporeon800' Brad's Avatar
    Join Date
    Apr 2001
    Location
    Vancouver, Canada
    Search PM
    Code:
    V0 = last
    
    V0.GreyScale()
    V1 = last
    
    V1
    MergeChroma(BlankClip(last,color=color_teal))
    V2 = last
    
    Interleave(V0,V1,V2)
    As I mentioned before, a lot of clipping happens because of the way that Y, U, and V interact.
    Quote Quote  
  19. Originally Posted by Mephesto View Post
    I'm looking to flatten the hue to a fixed value, nothing more. I don't want the saturation messed with.
    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.

    Originally Posted by Mephesto View Post
    I don't want everything not-teal to be gray but become teal too. the sat=0 kills color by default.
    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.
    Quote Quote  
  20. Originally Posted by manono View Post
    Originally Posted by Mephesto View Post
    Won't work because this will still **** with the sat and luma which I want untouched. I only need the hue flattened to one value.
    OK, then a picture is worth a thousand words (and a piece of the video even more). Just find 5 seconds of clean material to upload.
    k.
    Image Attached Images  
    Quote Quote  
  21. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    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
    Quote Quote  
  22. Originally Posted by hello_hello View Post
    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
    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.
    What you had was flattened hue AND flattened sat.
    Quote Quote  
  23. Originally Posted by Mephesto View Post
    Originally Posted by hello_hello View Post
    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
    Hue isn't a "shift", hue is hue, just like red isn't blue.
    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.
    Quote Quote  
  24. Originally Posted by jagabo View Post
    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). 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.
    Curious, how should I have formulated my post so it would be clear? I guess I shouldnt've said "removing" hue but I did clarify everything in the first post, did I not?
    Quote Quote  
  25. 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
    Quote Quote  
  26. 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:

    Click image for larger version

Name:	orig.jpg
Views:	207
Size:	63.7 KB
ID:	18174

    After Tweak(hue=-45).ColorYUV(cont_u=-256).Tweak(hue=45):

    Click image for larger version

Name:	hue.jpg
Views:	333
Size:	55.5 KB
ID:	18175

    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.
    Quote Quote  
  27. 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 ?
    Flatten the hue range but keep S and V as the original, yes.

    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?
    Quote Quote  
  28. The waveform and vectorscope graphs were made with VideoScope():

    Code:
    VideoScope("both", true, "U", "V", "UV")
    At the right edge is the U waveform, at the bottom is the V waveform, at the lower right is the UV plot. On the UV plot, spots near the center are low saturation (grey), spots near the edges are highly saturated (much more so than the background color of the graph implies). A straight line drawn from the center of the graph to an edge is a line of constant hue with varying saturation.

    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.
    Quote Quote  
  29. Do either of these look like what you're trying to do?

    Click image for larger version

Name:	teal.jpg
Views:	220
Size:	148.4 KB
ID:	18192
    Click image for larger version

Name:	teal2.jpg
Views:	194
Size:	149.5 KB
ID:	18191
    Quote Quote  
  30. Originally Posted by smrpix View Post
    Do either of these look like what you're trying to do?
    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?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!