# Layering (composite) filter

Source: https://ref.dm-lang.org/notes/filters/layer
Added in BYOND 513.

**Format**

> filter(type="layer", ...)

**Args**

> x: Horizontal offset of second image (defaults to 0)

Composites another image over or under this image. Using the `FILTER_OVERLAY` flag, which is the default, puts the second image on top of what's already here. `FILTER_UNDERLAY` puts it underneath.

The `x` and `y` values can move the mask from its normal position. By default, the second image is centered over the center of the first.

The `color`, `transform`, and `blend_mode` vars are available for convenience. Because the bottom image is drawn over a blank background, `blend_mode` is always applied to the top image. All of the other vars apply to the second image being drawn.

> [!note]
> 
> Transforms use default bilinear scaling, since [PIXEL_SCALE](https://ref.dm-lang.org/atom/var/appearance_flags.md) is not available here.

> [!note]
> 
> Like most other filters, this filter is **not** taken into account for mouse-hit purposes. Any layered icons will be strictly visual.

### See also
- [icon var (atom)](https://ref.dm-lang.org/atom/var/icon.md)
- [render_target var (atom)](https://ref.dm-lang.org/atom/var/render_target.md)
