Levels のバックアップの現在との差分(No.1)


  • 追加された行はこの色です。
  • 削除された行はこの色です。
 Levels(clip input, int input_low, float gamma, int input_high, int output_low,int output_high, bool coring)
#pre{{
Levels (clip, int input_low, float gamma, int input_high, int output_low, int output_high, bool "coring")
}}

The Levels filter adjusts brightness, contrast, and gamma. The input_low and input_high parameters determine what input pixel values are treated as pure black and pure white; the output_low and output_high parameters determine the output values corresponding to black and white; and the gamma parameter controls the degree of nonlinearity in the conversion. To be precise, the conversion function is:
Levels フィルタは、明るさ、コントラスト、ガンマを調節します(ガンマは 0 より大きくなければならない)。'''input_low''' パラメータと '''input_high''' パラメータは、どの入力ピクセル値が純粋な黒と純粋な白として扱われるかを決定します。'''output_low''' パラメータと '''output_high''' パラメータは、純粋な黒と純粋な白に一致する出力値を決定します。そして、'''gamma''' パラメータは、変換における非線形性の度合いをコントロールします。正確には、変換関数は以下の通りです:

 output = [(input - input_low) / (input_high - input_low)]1/gamma (output_high - output_low) + output_low 
 output = [(input - input_low) / (input_high - input_low)]^(1/gamma) * (output_high - output_low) + output_low

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. 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.
これは、GUI((訳者註: グラフィカル・ユーザー・インターフェイス(Graphical User Interface)の略。参考: [[IT用語辞典 e-Words:http://e-words.jp/w/GUI.html]])) があれば本当に素晴らしいフィルタの 1 つです。(少なくとも AviSynth の現行の形式においては) GUI を提供できないため、clip が RGB のときは、少なくともこのフィルタと VirtualDub の Levels フィルタに互換性を持たせることに決めました。その場合、VirtualDub の Levels フィルタのダイアログから数値を取って、パラメータとして(AviSynth の) Levels フィルタに渡せば、同じ結果が得られるはずです。しかし、入出力パラメータは、255 より大きくすることが可能です。

When processing data in YUY2 mode, Levels only gamma-corrects the luma information, not the chroma. Gamma correction is really an RGB concept, and I don't know how to do it properly in YUY2. However, if gamma = 1.0, the filter should have the same effect in RGB and YUY2 modes.
YUV モードでデータを処理するとき、Levels は、色差ではなく、輝度情報のみをガンマ補正します。ガンマ補正は、本来、RGB の概念であり、YUV でこれを適切に行う方法についてはわかりません。しかし、'''gamma''' = 1.0 なら、RGB モードと YUV モードで同じ効果が得られるはずです。明るさやコントラストを調整するには、[[Tweak]] か [[ColorYUV]] を使用した方がいいです。なぜなら、Levels はクリップの色差も変更するからです。

In v2.53 an optional coring = true/false (true by default, which reflects the behaviour in older versions) is added. When setting to true is means that the luma (Y) is clipped to [16,235], and when setting to false it means that the luma is left untouched.
v2.53 で、オプションとして '''coring''' = '''true/false''' (デフォルトは true。古いバージョンの挙動を反映する)が追加されました。~
'''coring''' = true: 入力輝度値は [16,235]((訳者註: [m,n] は値の範囲を表しています。[16,235] なら、16 から 235 までという意味です。)) に(色差は [16,240] に)切り詰められ、結果は [16,235] から [0,255] に *伸張* されます。変換は上述の公式に従って行われます。そして、出力は [0,255] から [16,235] に *圧縮* されます。~
'''coring''' = false: 変換は上述の公式に従って行われます。

Examples:
#pre{{
# [16,235] のクリップには何も行わないが、[0,255] のクリップを [16,235] に切り詰める(または丸める):
Levels(0, 1, 255, 0, 255)

# do nothing
# 入力は [16,235] から [0,255] に伸張され、(上記の公式に従って) [0,255]->[16,235] の変換が行われる。
# 出力は [0,255] から [16,235] に圧縮される: (例えば: [0,16] の輝度の値はすべて 30 に変換される)
Levels(0, 1, 255, 16, 235)

 Levels(0, 1, 255, 0, 255)
# より明るい環境のディスプレイ向けに画像をガンマ補正する:
# 例: 輝度 16 は 16 のまま、59 は 79 に変換される、など。
Levels(0, 1.3, 255, 0, 255)

# gamma-correct image for display in a brighter environment
# 画像を反転する(写真のネガを作成):
# 例: 輝度 16 は 235 に変換される
Levels(0, 1, 255, 255, 0)

 Levels(0, 1.3, 255, 0, 255)
# [0,255] のクリップには何も行わず、かつ、[16,235] のクリップにも何も行わない:
Levels(0, 1, 255, 0, 255, coring=false)

# invert the image (make a photo-negative)
# [0,255] のクリップを [16,235] に圧縮する:
Levels(0, 1, 255, 16, 235, coring=false)  # ColorYUV(levels="PC->TV") に同じ

 Levels(0, 1, 255, 255, 0)
# [16,235] のクリップを [0,255] に伸張する:
Levels(16, 1, 235, 0, 255, coring=false)  # ColorYUV(levels="TV->PC") に同じ
}}

#hr
註: このページは、http://www.avisynth.org/Levelsの日本語訳です。

註: このページは、AviSynth 2.5.8 RC3 に同梱されている英語版ヘルプの日本語訳です。原文は、AviSynth をインストールしたフォルダ内の Docs/english/corefilters/levels.htm にあります。なお、このページのテキストおよび画像のライセンスは、オリジナルのそれに準じます。詳しくは、[[AboutLicense]] を参照してください。