Difference between revisions of "Super Sample Layer"

From Synfig Studio :: Documentation
Jump to: navigation, search
m
m
 
(9 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Introduction ==
+
<!-- Page info -->
 +
{{Title|Super Sample Layer}}
 +
{{Category|Layers}}
 +
{{Category|Other}}
 +
{{NewTerminology}}
 +
<!-- Page info end -->
 +
 
 +
{{l|Image:Layer_other_supersample_icon.png|64px}}
 +
 
 +
== About Super Sample Layers==
  
 
The Super Sample layer is used to anti-alias all the layers under it.
 
The Super Sample layer is used to anti-alias all the layers under it.
  
 
It isn't often needed, since most layers produce smooth output already.
 
It isn't often needed, since most layers produce smooth output already.
 +
 +
 +
==Parameters of Supersample Layer==
 +
 +
The parameters of the supersample layer are:
 +
 +
{|border="0" align="left" style="border-collapse"  cellpadding="3" cellspacing="0"
 +
|-style="background:#silver"
 +
|'''Name'''||'''Value'''||'''Type''' 
 +
|-style="background:#"
 +
||{{l|Image:Type_integer_icon.png|16px}} Width
 +
||2
 +
||integer
 +
 +
|-style="background:#eeeeee"
 +
||{{l|Image:Type_integer_icon.png|16px}} Height
 +
||2
 +
||integer
 +
 +
|-style="background:#"
 +
||{{l|Image:Type_bool_icon.png|16px}} Use Parametric
 +
||
 +
{| style="width:16px; height:16px" border="1"
 +
|-
 +
|}
 +
||bool
 +
 +
|-style="background:#eeeeee"
 +
||{{l|Image:Type_bool_icon.png|16px}} Be Alpha Safe
 +
||
 +
{| style="width:16px; height:16px" border="1"
 +
|-
 +
|}
 +
||bool
 +
 +
|}
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
 +
  
 
You specify width and a height parameters.  Internally, the scene is rendered <width> times wider and <height> times taller than the output image, and then each <width> by <height> block is averaged down to a single pixel.
 
You specify width and a height parameters.  Internally, the scene is rendered <width> times wider and <height> times taller than the output image, and then each <width> by <height> block is averaged down to a single pixel.
Line 11: Line 71:
 
This shows a zoomed image of an outline with anti-alias turned off, and without a supersample layer:
 
This shows a zoomed image of an outline with anti-alias turned off, and without a supersample layer:
  
[[Image:Supersample-none.png]]
+
{{l|Image:Supersample-none.png}}
  
The 'Use Parametric' checkbox makes it use the [[parametric renderer]] rather than the default [[accelerated renderer]].
+
The 'Use Parametric' checkbox makes it use the {{l|parametric renderer}} rather than the default {{l|accelerated renderer}}.
  
 
The 'Be Alpha Safe' checkbox makes the averaging process aware of the alpha channel.  When 'Alpha Safe', the average is sum(color * alpha)/sum(alpha), with an alpha value of sum(alpha)/sum(1).  When not 'Alpha Safe', the average is simply sum(color)/sum(1).
 
The 'Be Alpha Safe' checkbox makes the averaging process aware of the alpha channel.  When 'Alpha Safe', the average is sum(color * alpha)/sum(alpha), with an alpha value of sum(alpha)/sum(1).  When not 'Alpha Safe', the average is simply sum(color)/sum(1).
Line 21: Line 81:
 
This is the same outline as before, but with a Super Sample layer over the top of it.  This one is with 'Be Alpha Safe' enabled:
 
This is the same outline as before, but with a Super Sample layer over the top of it.  This one is with 'Be Alpha Safe' enabled:
  
[[Image:Supersample-safe.png]]
+
{{l|Image:Supersample-safe.png}}
  
 
And this one is without 'Be Alpha Safe'.  The background is a strong blue, but with a very low Alpha.  The edges are much bluer than they would be if alpha was taken into account:
 
And this one is without 'Be Alpha Safe'.  The background is a strong blue, but with a very low Alpha.  The edges are much bluer than they would be if alpha was taken into account:
  
[[Image:Supersample-unsafe.png]]
+
{{l|Image:Supersample-unsafe.png}}
  
 
It's worth pointing out that the Super Sample layer is disabled when the 'quality' setting is 10 or higher.  During editing, the quality is 10.
 
It's worth pointing out that the Super Sample layer is disabled when the 'quality' setting is 10 or higher.  During editing, the quality is 10.
Line 35: Line 95:
 
{|  
 
{|  
 
| width=1 height=1
 
| width=1 height=1
| [[Image:Perp-curve-gradient-3-ss1x1.png]]
+
| {{l|Image:Perp-curve-gradient-3-ss1x1.png}}
 
| this is the same as not using Super Sample at all
 
| this is the same as not using Super Sample at all
 
|-
 
|-
 
| width=2 height=2
 
| width=2 height=2
| [[Image:Perp-curve-gradient-3-ss2x2.png]]
+
| {{l|Image:Perp-curve-gradient-3-ss2x2.png}}
 
| notice how there's only one intermediate color used to antialias in the very bottom right corner
 
| notice how there's only one intermediate color used to antialias in the very bottom right corner
 
|-
 
|-
 
| width=3 height=3
 
| width=3 height=3
| [[Image:Perp-curve-gradient-3-ss3x3.png]]
+
| {{l|Image:Perp-curve-gradient-3-ss3x3.png}}
 
| now two intermediate colors are used, and the result is smoother
 
| now two intermediate colors are used, and the result is smoother
 
|-
 
|-
 
| width=4 height=4
 
| width=4 height=4
| [[Image:Perp-curve-gradient-3-ss4x4.png]]
+
| {{l|Image:Perp-curve-gradient-3-ss4x4.png}}
 
| this looks good, but a 4x4 Super Sample layer increases the render time by a factor of 16
 
| this looks good, but a 4x4 Super Sample layer increases the render time by a factor of 16
 
|-
 
|-
 
| width=1 height=4
 
| width=1 height=4
| [[Image:Perp-curve-gradient-3-ss1x4.png]]
+
| {{l|Image:Perp-curve-gradient-3-ss1x4.png}}
 
| vertical lines are jagged, horizontal lines are smooth
 
| vertical lines are jagged, horizontal lines are smooth
 
|-
 
|-
 
| width=4 height=1
 
| width=4 height=1
| [[Image:Perp-curve-gradient-3-ss4x1.png]]
+
| {{l|Image:Perp-curve-gradient-3-ss4x1.png}}
 
| vertical lines are smooth, horizontal lines are jagged
 
| vertical lines are smooth, horizontal lines are jagged
 
|}
 
|}

Latest revision as of 13:05, 26 February 2017

Languages Language: 

English


Layer other supersample icon.png

About Super Sample Layers

The Super Sample layer is used to anti-alias all the layers under it.

It isn't often needed, since most layers produce smooth output already.


Parameters of Supersample Layer

The parameters of the supersample layer are:

Name Value Type
Type integer icon.png Width 2 integer
Type integer icon.png Height 2 integer
Type bool icon.png Use Parametric
bool
Type bool icon.png Be Alpha Safe
bool









You specify width and a height parameters. Internally, the scene is rendered <width> times wider and <height> times taller than the output image, and then each <width> by <height> block is averaged down to a single pixel.

For example, the output image is 320x240 pixels, the width and height parameters of the Super Sample layer are both set to the default value of 2. Synfig will render a 640x480 image internally, and then average the 4 pixels in each 2x2 block down into a single pixel that it then uses in the output image.

This shows a zoomed image of an outline with anti-alias turned off, and without a supersample layer:

Image:Supersample-none.png

The 'Use Parametric' checkbox makes it use the Parametric renderer rather than the default Accelerated renderer.

The 'Be Alpha Safe' checkbox makes the averaging process aware of the alpha channel. When 'Alpha Safe', the average is sum(color * alpha)/sum(alpha), with an alpha value of sum(alpha)/sum(1). When not 'Alpha Safe', the average is simply sum(color)/sum(1).

For instance, consider averaging two pixels, one a completely transparent blue (R:0 G:0 B:1 A:0) and the other an opaque red (R:1 G:0 B:0 A:1). When being alpha safe, the average is (R:1 G:0 B:0 A:0.5). When not being alpha safe, the average is (R:0.5 G:0 B:0.5 A:0.5).

This is the same outline as before, but with a Super Sample layer over the top of it. This one is with 'Be Alpha Safe' enabled:

Image:Supersample-safe.png

And this one is without 'Be Alpha Safe'. The background is a strong blue, but with a very low Alpha. The edges are much bluer than they would be if alpha was taken into account:

Image:Supersample-unsafe.png

It's worth pointing out that the Super Sample layer is disabled when the 'quality' setting is 10 or higher. During editing, the quality is 10.

If you want to see an example of what Super Sample does, create an outline and turn off it's anti-aliasing parameter. It will look jagged around the edges. Add a Super Sample layer over the top of it, save the file and render it to an image. Rendering with 'synfig -Q 10 file.sif' will leave it jagged, and 'synfig -Q 9 file.sif' will make it smoother.

Examples

width=1 height=1 Image:Perp-curve-gradient-3-ss1x1.png this is the same as not using Super Sample at all
width=2 height=2 Image:Perp-curve-gradient-3-ss2x2.png notice how there's only one intermediate color used to antialias in the very bottom right corner
width=3 height=3 Image:Perp-curve-gradient-3-ss3x3.png now two intermediate colors are used, and the result is smoother
width=4 height=4 Image:Perp-curve-gradient-3-ss4x4.png this looks good, but a 4x4 Super Sample layer increases the render time by a factor of 16
width=1 height=4 Image:Perp-curve-gradient-3-ss1x4.png vertical lines are jagged, horizontal lines are smooth
width=4 height=1 Image:Perp-curve-gradient-3-ss4x1.png vertical lines are smooth, horizontal lines are jagged


Languages Language: 

English