Welcome Guest ( Log In | Register )


Important

The forums will be closing permanently the weekend of March 15th. Please see the notice in the announcements forum for details.

Pages: (2) 1 [2]  ( Go to first unread post )
Avisynth Filters, Levels, Spatialsoften, TemporalSoften
« Next Oldest | Next Newest » Track this topic | Email this topic | Print this topic
trevlac
Posted: Jun 3 2004, 05:03 AM


Advanced Member


Group: Members
Posts: 176
Member No.: 8501
Joined: 26-January 04



Richard,

I am being a little silly (kind of the flavor of this thread), but to quote the avisynth doc on levels:

QUOTE

This is one of those filters for which it would really be nice to have a GUI. Since I can't offer a GUI (at least not in AviSynth's current form), I decided I could at least make this filter compatible with VirtualDub's when the clip is RGB. In that case you should be able to take the numbers from VirtualDub's Levels dialog and pass them as parameters to the Levels filter and get the same results.


So pointing out that the doc is bad and suggesting the same thing it says, is not fair. Well, maybe not exactly the same thing, but that's what I ment. wink.gif

Don't get me wrong. Critical comments about the doc, the filters, the software; are great. Heck, I didn't write any of them so it shouldn't hurt my feelings. Hopefully I gave cricket some info. Hopefully it was right! Maybe he can come back with some more details. I assume there is a reason to know levels, SS, TS. smile.gif

Cheers
 
     Top
Wilbert
Posted: Jun 3 2004, 08:59 AM


Advanced Member


Group: Members
Posts: 132
Member No.: 6270
Joined: 11-September 03



I take it that you use the script editor in VdubMod to adjust values of AviSynth scripts. If not, you should try it.

QUOTE
I hope we are all just having a good time with this but maybe one example per filter with a .JPG insert in the manual might make things a little easier for us non-brainers.


Maybe I'm misunderstand you, but there are several examples given in (ok, maybe you want to see more of them)

http://www.avisynth.org/index.php?page=Levels

You can easily try those examples on a clip and see what they do.

Sometimes we add screenshots to a filter description, but it is impossible to add screenshots for every filter (download package will be twice as large).
QUOTE
Oh this just in http://forum.doom9.org/showthread.php?s=&t...&threadid=77358

Someone complaining that levels has no default values smile.gif The docs don't suggest otherwise, so it's purely an implementation issue.

To repeat my question again (besides the filters mentioned in this thread)
QUOTE
If people just say which manual pages are not clear, we can do something about it. Which ones do you want to see improved?

 
     Top
rfmmars
Posted: Jun 3 2004, 01:32 PM


Advanced Member


Group: Members
Posts: 324
Member No.: 5438
Joined: 29-July 03



Yes I use Note Book left open when I am adjusting a Avisynth script. I think that we all fail to remember that at one time we were newbies ourselves.

I am in awh with your guys who can write that suff, but some of us just can't grab on to it that easily.

I can design and build at TV station from the bottom up, thats my nitch, but need more help with Avisynth as does Cricket.

richard
 
     Top
trevlac
Posted: Jun 3 2004, 01:48 PM


Advanced Member


Group: Members
Posts: 176
Member No.: 8501
Joined: 26-January 04



Does cricket have enough info ...


I didn't want to go on and on. But it is a bunch easier to solve a specific problem than to talk in general terms.

Hopefully he/she was not too intimidated to say his/her specific problem (for fear of sounding dumb). I'd say I sound dumb on about every even post. On the odd ones, I just try to confuse the matter so no one knows what I am talking about. smile.gif

I wanted to vote for the histogram as being the worst documented filter. What the heck do you use 'color mode' for anyway? biggrin.gif
 
     Top
cricket
Posted: Jun 3 2004, 10:53 PM


Advanced Member


Group: Members
Posts: 106
Member No.: 9712
Joined: 6-April 04



It's quite amusing to see how an innocent post of mine can create such a constructive (or may be not) dialogues.
For your info trevlac, I am not intimidated. It's only a forum. Frankly if I was intimidated, I would not have been here at the first place. May be it's a good time to go to the root of my problem. Below is the copy of the Levels parametes as in Avisynth:

Levels(clip input, int input_low, float gamma, int input_high, int output_low,int output_high, bool coring)

Now for a lay man like me, it seems that Levels take 7 arguments. However when you go down further, one can see examples such as:

Levels(0, 1, 255, 255, 0)

You see this is where the confusion starts. I believe that Levels take 7 arguments where as in the example it only shows 5. I did test this example on my clip and can see what the filter is doing. Look most of us can do trial and error and figure out what the filter is doing, however while writing an explanation, one should take into account the lowest denominator. I am neither the smartest or the dumbest however by any standard this expression:

Levels(clip input, int input_low, float gamma, int input_high, int output_low,int output_high, bool coring)

still looks like a jargon. I would much prefer the way Donald Graft explains his filters. It may seem very lame to so called specialists, however certainly it will make us beginners life lot easier.

Many thanks all the resposes.
 
     Top
neuron2
Posted: Jun 4 2004, 02:40 AM


Advanced Member


Group: Members
Posts: 1244
Member No.: 5294
Joined: 18-July 03



QUOTE (cricket @ Jun 3 2004, 04:53 PM)
I would much prefer the way Donald Graft explains his filters.

Yeah, but who has time for all that? Do you know how much effort it takes to write good documentation? That Graft, sheesh, he must not even have a girlfriend or anything. Ya know? wub.gif

You can omit args at the end of the list. If you do, they take the default values. I'm sure it's documented...somewhere.
 
    Top
cricket
Posted: Jun 4 2004, 04:36 AM


Advanced Member


Group: Members
Posts: 106
Member No.: 9712
Joined: 6-April 04



QUOTE
That Graft, sheesh, he must not even have a girlfriend or anything. Ya know?


I believe and many would agree that refering Donald Graft as "That Graft" is very disrespectful. And also it seems you are not answering my query so do not really quite understand why you even bother posting on this particular topic.

Is there someone else who can answer my query please.
 
     Top
fccHandler
Posted: Jun 4 2004, 06:08 AM


Administrator n00b


Group: Moderators
Posts: 3961
Member No.: 280
Joined: 13-September 02



QUOTE (cricket @ Jun 4 2004, 12:36 AM)
I believe and many would agree that refering Donald Graft as "That Graft" is very disrespectful.

That Graft is a riot. biggrin.gif

Hint: If you didn't get neuron2's joke, check out his web page at http://neuron2.net.

--------------------
May the FOURCC be with you...
 
     Top
cricket
Posted: Jun 4 2004, 07:34 AM


Advanced Member


Group: Members
Posts: 106
Member No.: 9712
Joined: 6-April 04



always suspected...

aight
 
     Top
trevlac
Posted: Jun 4 2004, 02:34 PM


Advanced Member


Group: Members
Posts: 176
Member No.: 8501
Joined: 26-January 04



@cricket,

All kidding aside ... hopefully I am answering your question. You have a nice fresh perspective and you make the effort to voice it. Made me realize that I have become one of those Avisynth robot zombies that hang around doom9. wacko.gif


I think the root of the confusion is the 'flexible' syntax allowed by Avisynth. That and the fact that there are some nice things that don't have to be provided by the filter programmer. Once

-------------

If an Avisynth Filter accepts a clip as the 1st parameter, this parameter is optional. If the clip is not provided, the 'last' clip in the script is used. Also, a special variable 'last' can be used to refer to this last clip. For example:

CODE

Version()
Levels(0,1,255,0,255, coring=false)

is the same as

myClip=Version()
Levels(myClip, 0,1,255,0,255, coring=false)

is the same as

Version()
Levels(last, 0,1,255,0,255, coring=false)


SOME filters accept named parameters. If the programmer was nice, this makes usage more clear. Named parameters can be used in any order. Unnamed ones must be in the correct order. Levels has 1 named parameter 'coring'.

CODE

This does not work
Levels(input_low=0, gamma=1, input_high=255, output_low=0, output_high=255, coring=true)

This does
Levels(myClip, 0,1,255,0,255, coring=true)

So does this
Tweak(sat=2.0,bright=-20)



SOME filters provide default values for parameters. These parameters are then 'optional'. Levels only has 1 optional parameter. 'coring' who's default value is true.

CODE

Levels(0,1,255,0,255, coring=true)

is the same as

Levels(0,1,255,0,255)

is the same as

Levels(0,1,255,0,255,true)


In the end ... I'd say that neuron is a more thoughtful programmer/designer. IMHO Levels is an example of an (old) poor concept that went everywhere. Like I said, even Photoshop has a levels filter. It is from the perspective of how you change the colors in an image, -vs- what you would really want to do. IE ...How = map the input range to a new output range, -vs- What = make the picture darker, lighter, juice up the colors, change the colors. Tweak in comparison has defaults and names for all of it's parameters. The parameters match what traditional TV adjustments do. Brightness makes the whole picture brighter/darker. Contrast stretches the range from dark to bright. Saturation juices up the colors. Hue changes the colors. BTW: Citizen Graft wrote Tweak. wink.gif


 
     Top
Wilbert
Posted: Jun 4 2004, 11:19 PM


Advanced Member


Group: Members
Posts: 132
Member No.: 6270
Joined: 11-September 03



@Trev,

QUOTE
SOME filters accept named parameters. If the programmer was nice, this makes usage more clear. Named parameters can be used in any order. Unnamed ones must be in the correct order. Levels has 1 named parameter 'coring'.


All parameters are named parameters. Also the ones of levels:
CODE

class Levels : public GenericVideoFilter
/**
 * Class for adjusting levels in a YUV clip
**/
{
public:
 Levels( PClip _child, int in_min, double gamma, int in_max, int out_min, int out_max, bool coring,
         IScriptEnvironment* env );

Some of the named arguments are different as the ones in the docs. This can be the case for more filters. But, that doesn't matter. What matters is that the optional named arguments are the same as in the docs.
 
     Top
trevlac
Posted: Jun 5 2004, 12:09 AM


Advanced Member


Group: Members
Posts: 176
Member No.: 8501
Joined: 26-January 04



@wilbert,

Those are the internal variable names.

What I was referring to was the parameter names in a script.

Levels(input_low=0, gamma=1, input_high=255, output_low=0, output_high=255, coring=true)

Would be more clear in the doc if the above worked. But it does not, because the filter does not allow you to use names for the parameters.

In the code, this is in some declare thing usually at the bottom of a filter. I'm not at a computer where I can look at any code right now, but IIRC, it looks like ci[input_low]i[gamma]i[input_high] .... b[coring].


As far as 'optional' goes ... Arg[1].int(0) or something like that ... sets the defaults. Not sure if a named param is always optional ...

[edit]

Well it seems that named parameters are optional, but that does not mean there is a default. Also an interesting point. In levels, the values are not checked for any range. You can provide things like 999.

I made a levels filter to test this all. http://trevlac.us/wilbert/levelsX.rar

The params are now all named (optional). However, I do not default the input_low. It seems to get a big value (probably what is in the memory spot.) Others are defaulted to "do nothing" values. Usage LevelsX(input_low=0).
 
     Top
cricket
Posted: Jun 5 2004, 01:22 PM


Advanced Member


Group: Members
Posts: 106
Member No.: 9712
Joined: 6-April 04



thank you all guys..I am sure by looking at number of visits to this particular post, I am sure many of us a bit more enlightened now.

Appreciated..
 
     Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
27 replies since Jun 1 2004, 05:01 AM Track this topic | Email this topic | Print this topic
Pages: (2) 1 [2] 
<< Back to Avisynth Filtering, Processing and Scripts Discussion