# Layers
## Common Properties
Layer
{schema_string:layers/layer/description}
{schema_object:layers/layer}
The `ty` property defines the specific layer type based on the following values:
{schema_subtype_table:layers/all-layers:ty}
#### Visibility Range
A layer is visible on frame `t` when `ip <= t < op`. The `ip` (In Point) boundary is
inclusive, and the `op` (Out Point) boundary is exclusive — the frame at `op` is NOT
rendered. This matches the Animation-level [`ip`/`op`](composition.md#animation)
semantics.
`op` MUST NOT be less than `ip`.
Visual Layer
{schema_string:layers/visual-layer/description}
{schema_object:layers/visual-layer}
#### Parenting
Layer parenting offers a way to connect layers such that the movement of one layer (child) follows
the movement of another (parent). Multiple child layers can reference the same parent (this is
useful for applying the same transform animation to a group of layers).
When the `parent` property points to another layer, the referencing layer's current transformation
matrix (CTM) is composed with the parent CTM:
$$CTM(child) = CTM(parent) \times Transform(child)$$
Parenting is transitive, and reference cycles are not allowed (undefined behavior).
#### Hidden Layers
The hidden flag `hd` determines whether a layer is rendered: hidden layers are not rendered as
part of the normal layer tree, but their properties and content are evaluated when used as a
reference target in other contexts.
Specifically, hidden layers
* contribute to a layer's total transform when used as a `parent`
* contribute to a layer's track matte when used as a matte source
`hd` only affects the layer for which it is defined, it does not transitively apply to other
referencing layers.
#### Mattes
A matte allows using a layer as a mask for another layer.
The way it works is the layer defining the mask has a `tt` attribute with the
appropriate [value](constants.md#matte-mode).
The layer being masked is indicated by the `tp` attribute, which has the index (`ind`) of the layer that is being masked.
In this example there's a layer with a rectangle and a star being masked by an ellipse:
{: .print-site-plugin-ignore }
Example
{...lottie.layers[1], shapes: [], ks: {}}
## Layer types
Shape Layer
{schema_string:layers/shape-layer/description}
{schema_object:layers/shape-layer}
Image Layer
{schema_string:layers/image-layer/description}
{schema_object:layers/image-layer}
Null Layer
{schema_string:layers/null-layer/description}
{schema_object:layers/null-layer}
Solid Layer
{schema_string:layers/solid-layer/description}
{schema_object:layers/solid-layer}
Precomposition Layer
{schema_string:layers/precomposition-layer/description}
{schema_object:layers/precomposition-layer}
Time Stretch
The `st` property specifies a start time offset, while `sr` defines a time stretch factor,
to be applied when evaluating animated properties pertaining to the layer:
$$t\prime = \dfrac{t}{stretch} - start$$
`sr` values less than $1$ increase the layer playback speed, while values greater than $1$
decrease it ("stretching" the layer timeline).
Example
lottie.layers[0]
Time Remap
The `tm` property specifies a time remap function as an animatable property, allowing full control
over the precomp timeline (subset, speedup/slowdown, reverse, frame-freeze, or any other arbitrary
transformation).
It maps the current layer time (in the half-open frame index $[ip, op)$ domain) to a precomp time
expressed in seconds, and evaluates all animatable precomp properties based on the new time value:
$$tm \colon \left[ip, op\right) \mapsto seconds$$
$$t\prime = tm(t) \cdot FPS$$
Note: the global frame rate factor $FPS$ ([Animation](composition.md#Animation) `fr` property) is
required to convert back into the frame index domain.
When both time stretch (`sr`) and time remap (`tm`) are specified, time stretch is applied first.
Example
lottie.layers[1].tm