Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
31st December 2004, 04:04 | #1 | Link |
Registered Jedi
Join Date: Jan 2003
Location: Georgia, U.S.A.
Posts: 733
|
How to adjust RGB saturation?
I seem to have run into a brick wall here. I want to adjust the saturation of an RGB clip to 83% in Avisynth, and there doesn't seem to be any way to do it without converting to YUY2. I prefer not to do that because I'm trying to fit Avisynth into a larger processing chain and I don't want to downsample the chroma information at this stage in the chain. (It's a long story...)
The documentation mentions a function called "HSIAdjust" which existed in earlier versions, but was removed in favor of a newer "Tweak" function which only supports YUV. Did the "HSIAdjust" function support RGB? And if so, which was the last version of Avisynth to include it? Is there any other way (besides Tweak) to adjust saturation in Avisynth, and keep the full RGB image?
__________________
May the FOURCC be with you... |
31st December 2004, 04:21 | #2 | Link |
Guest
Posts: n/a
|
There is a virtualdub filter you could import to do this, http://neuron2.net/hue.html
|
31st December 2004, 05:28 | #3 | Link |
Registered Jedi
Join Date: Jan 2003
Location: Georgia, U.S.A.
Posts: 733
|
Thank you. Actually I tried doing that but I couldn't figure out the parameter list for the filter in Avisynth. Can you help?
FWIW, here is an example of what I tried: Code:
LoadVirtualDubPlugin("Hue.vdf","Hue",0) AVISource("Video1.avi") Hue(0,0.85,1,"rgbycm")
__________________
May the FOURCC be with you... |
31st December 2004, 05:41 | #4 | Link |
AviSynth Enthusiast
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
|
It's easier if you use the VirtualDub filter import script.
If you look at the VD_Hue function, you will see that the last argument isn't a string; it's a bitmask. |
31st December 2004, 06:05 | #5 | Link |
Registered Jedi
Join Date: Jan 2003
Location: Georgia, U.S.A.
Posts: 733
|
Thanks, hopefully that will get me going again.
Forgive me for a little rant, but I consider it a gross oversight if the current Avisynth can't perform such a simple, basic task internally. Furthermore, I think it's an embarrassment if the "HSIAdjust" filter was removed unnecessarily without a suitable replacement filter in place. (To be fair though, I still don't know for certain that "HSIAdjust" supported RGB...) A humble plea to the developers: Any chance the "Tweak" filter will support RGB in the future?
__________________
May the FOURCC be with you... |
31st December 2004, 06:28 | #7 | Link |
Registered Jedi
Join Date: Jan 2003
Location: Georgia, U.S.A.
Posts: 733
|
Hmm... What page is that from? The reference I'm accustomed to is http://www.avisynth.org/Tweak but it doesn't mention colorspace support.
The Avisynth version I'm currently using is 2.54 (January 26, 2004). Can you confirm that upgrading to the latest version will enable RGB in Tweak? (I tend to loathe upgrading my trusted software...)
__________________
May the FOURCC be with you... |
31st December 2004, 06:32 | #8 | Link |
Guest
Posts: n/a
|
I got that snapshot from: http://www.avisynth.org/FiltersByCategory which lists the filters and the colorspaces they support.
Last edited by ObiKenobi; 31st December 2004 at 06:49. |
31st December 2004, 06:41 | #9 | Link |
Registered Jedi
Join Date: Jan 2003
Location: Georgia, U.S.A.
Posts: 733
|
It doesn't work in my version. I get the error "Tweak: YUV data only (no RGB)." Have you actually tried it yourself? If the newest version will work then I'll certainly upgrade, but it would be nice to have some confirmation first.
__________________
May the FOURCC be with you... |
31st December 2004, 06:47 | #10 | Link |
Registered Jedi
Join Date: Jan 2003
Location: Georgia, U.S.A.
Posts: 733
|
You edited your post! No fair.
To address your edit, I'm not at all confident that the information on your linked page is correct. So to say that "HSIAdjust" supported the same colorspaces as "Tweak" is worthless if we can't confirm that Tweak supports the colorspaces listed.
__________________
May the FOURCC be with you... |
31st December 2004, 07:13 | #14 | Link |
Registered Jedi
Join Date: Jan 2003
Location: Georgia, U.S.A.
Posts: 733
|
You edited your (already edited) post again!
You realize this disrupts the flow of the conversation? Anyway, I guess I'll wait a while and see if Wilbert has any thoughts to contribute. It seems to me a bit of a hassle to have to import an external VirtualDub filter to perform what (I believe) should be an inherent task. But thanks ObiKenobi for your quick responses! I much appreciate it.
__________________
May the FOURCC be with you... |
31st December 2004, 07:14 | #15 | Link | ||
Guest
Posts: n/a
|
Quote:
Quote:
Last edited by ObiKenobi; 31st December 2004 at 07:17. |
||
31st December 2004, 08:59 | #17 | Link |
Registered Jedi
Join Date: Jan 2003
Location: Georgia, U.S.A.
Posts: 733
|
You are right again, stickboy.
But don't you think "described" is too strong a word? My copy of changelist.htm just says, "Removed HSIAdjust()." Two words, plain and simple. Hardly what I would call a "description". Really just a "notification." And not even close to an "explanation". Anyway my problem has been solved for the moment, with your help, and I'm encoding my video right now. Your suggestion to use the VirtualDub filter import script did the trick. Thanks also for checking the HSIAdjust function. So are we to conclude that control of RGB saturation has never been supported in any version of Avisynth? (I'm shocked.)
__________________
May the FOURCC be with you... |
31st December 2004, 09:20 | #18 | Link |
Registered User
Join Date: Nov 2001
Posts: 291
|
Maybe this
http://www.avisynth.org/RGBAdjust another thread with same subjetc http://forum.doom9.org/showthread.ph...ight=RGBAdjust I hope this can be usefull ARDA |
31st December 2004, 09:36 | #19 | Link | |||
AviSynth Enthusiast
Join Date: Jul 2002
Location: California, U.S.
Posts: 1,267
|
Quote:
Adjusting saturation doesn't make a lot of sense in RGB. It'd probably have to convert to YUV internally anyway. It's too bad that AviSynth supports only YUY2 and YV12, though, which downsample the chroma. Quote:
If you want a fuller explanation: Quote:
|
|||
31st December 2004, 14:12 | #20 | Link | |||
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Hi guys
Quote:
1) Tweak requires YUV (I corrected the info at www.avisynth.org). 2) HSIAdjust also required YUV (I corrected the info at www.avisynth.org). Quote:
clip.ConvertToYUY2.Tweak(hue=...) The main difference is that with Tweak you have to rotate the entire range of colors, while in VD_Hue you can rotate just a few colors. I think TweakColor (by Trevlac) can do the latter though. The problem with Graft's hue filter is that I don't understand where the hue transformation is coming from. Perhaps someone can explain it to me? The relation between hue and (r,g,b) is nonlinear, but it is linearized in some way. I guess I have to ask Donald about this when he comes back. Quote:
Last edited by Wilbert; 31st December 2004 at 14:16. |
|||
|
|