AWarpsharp2/aWarp
From Avisynth wiki
(Difference between revisions)
m (minor formatting) |
(small documentation update) |
||
Line 1: | Line 1: | ||
{{FilterCat4|External_filters|Plugin_functions|Adjustment_filters|Sharpeners}} | {{FilterCat4|External_filters|Plugin_functions|Adjustment_filters|Sharpeners}} | ||
− | + | <tt>aWarp</tt> is designed for a more custom warp-sharpening than <tt>[[/aWarpSharp2|aWarpSharp2]]</tt> allows. | |
− | + | ||
− | < | + | |
− | + | ||
− | aWarp is designed for a more custom warp-sharpening than [[/aWarpSharp2|aWarpSharp2]] allows. | + | |
<br> | <br> | ||
<br> | <br> | ||
Line 14: | Line 10: | ||
<br> | <br> | ||
::{{Par2| |clip| |}} | ::{{Par2| |clip| |}} | ||
− | :::Edge mask clip; usually the input clip processed by [[AWarpsharp2/aSobel|aSobel]] and followed by [[AWarpsharp2/aBlur|aBlur]]. | + | :::Edge mask clip; usually the input clip processed by <tt>[[AWarpsharp2/aSobel|aSobel]]</tt> and followed by <tt>[[AWarpsharp2/aBlur|aBlur]]</tt>. |
− | :::If you want more stable results it's good idea to do anti-aliasing and temporal filtering on the edge mask before passing it to the warping stage. | + | :::If you want more stable results it's good idea to do anti-aliasing and temporal filtering (if necessary) on the edge mask before passing it to the warping stage. |
<br> | <br> | ||
::{{Par2|depth|int|3}} | ::{{Par2|depth|int|3}} | ||
− | :::Strength of the final warping. Negative values result in warping in opposite direction. | + | :::Strength of the final warping. Negative values result in warping in opposite direction, i.e. will blur the image instead of sharpening. |
+ | :::Range: -128 to 127 | ||
− | ::: | + | :::<span style="color:red">'''Note:'''</span> Chroma channels are internally processed with <code>{{Template:FuncDef|depth}}/2</code>. |
<br> | <br> | ||
::{{Par2|chroma|int|4}} | ::{{Par2|chroma|int|4}} | ||
− | :::Processing mode for chroma | + | :::Processing mode for the chroma channels (U and V): |
− | + | :::* 0 : fill with 0x80(128), output is grayscale. | |
− | + | :::* 1 : don't care - chroma will be trashed. | |
− | + | :::* 2 : copy chroma channels from the input clip. | |
− | + | :::* 3 : process chroma; create an edge mask from each chroma channel and use those to warp each chroma channel individually. | |
− | + | :::* 4 : process chroma; use the edge mask from the luma to warp the chroma channels. | |
− | + | :::* 5 : same as 3, but don't process luma. | |
− | + | :::* 6 : same as 4, but don't process luma. | |
+ | :::Luma plane (Y) is always processed, except for mode 5 and 6 which simply copy the luma channel from the input clip. | ||
<br> | <br> | ||
== Examples == | == Examples == | ||
− | + | The following example is identical to <code>[[/aWarpSharp2|aWarpSharp2()]]</code>: | |
input = [[AviSource]]("Blah.avi") | input = [[AviSource]]("Blah.avi") | ||
− | edge_mask = input.aSobel(thresh=128, chroma=1).aBlur(blur= | + | edge_mask = input.aSobel(thresh=128, chroma=1).aBlur(blur=2, type=0, chroma=1)<br> |
− | aWarp(input, edge_mask, depth= | + | aWarp(input, edge_mask, depth=16, chroma=4) |
<br> | <br> | ||
The following examples are written differently but are identical to the one above. | The following examples are written differently but are identical to the one above. | ||
[[AviSource]]("Blah.avi") | [[AviSource]]("Blah.avi") | ||
− | aWarp(aSobel().aBlur()) | + | aWarp(aSobel().aBlur(blur=2, type=0), depth=16) |
input = [[AviSource]]("Blah.avi") | input = [[AviSource]]("Blah.avi") | ||
− | edge_mask = input.aSobel().aBlur()<br> | + | edge_mask = input.aSobel().aBlur(blur=2, type=0)<br> |
− | aWarp(input, edge_mask) | + | aWarp(input, edge_mask, depth=16) |
<br> | <br> | ||
-------------------------------------------------------- | -------------------------------------------------------- | ||
'''Back to [[aWarpSharp2#Filters|aWarpSharp2]] ←''' | '''Back to [[aWarpSharp2#Filters|aWarpSharp2]] ←''' |
Latest revision as of 01:04, 10 November 2015
aWarp is designed for a more custom warp-sharpening than aWarpSharp2 allows.
[edit] Syntax and Parameters
- aWarp (clip, clip, int "depth", int "chroma")
- clip =
- Input clip.
- clip =
- int depth = 3
- Strength of the final warping. Negative values result in warping in opposite direction, i.e. will blur the image instead of sharpening.
- Range: -128 to 127
- int depth = 3
- Note: Chroma channels are internally processed with
depth/2
.
- Note: Chroma channels are internally processed with
- int chroma = 4
- Processing mode for the chroma channels (U and V):
- 0 : fill with 0x80(128), output is grayscale.
- 1 : don't care - chroma will be trashed.
- 2 : copy chroma channels from the input clip.
- 3 : process chroma; create an edge mask from each chroma channel and use those to warp each chroma channel individually.
- 4 : process chroma; use the edge mask from the luma to warp the chroma channels.
- 5 : same as 3, but don't process luma.
- 6 : same as 4, but don't process luma.
- Luma plane (Y) is always processed, except for mode 5 and 6 which simply copy the luma channel from the input clip.
- Processing mode for the chroma channels (U and V):
- int chroma = 4
[edit] Examples
The following example is identical to aWarpSharp2()
:
input = AviSource("Blah.avi") edge_mask = input.aSobel(thresh=128, chroma=1).aBlur(blur=2, type=0, chroma=1)
aWarp(input, edge_mask, depth=16, chroma=4)
The following examples are written differently but are identical to the one above.
AviSource("Blah.avi") aWarp(aSobel().aBlur(blur=2, type=0), depth=16)
input = AviSource("Blah.avi") edge_mask = input.aSobel().aBlur(blur=2, type=0)
aWarp(input, edge_mask, depth=16)
Back to aWarpSharp2 ←