SVG Filter in Attribute
The in attribute selects a filter primitive's input, whether a built-in keyword like SourceGraphic or a named prior result.
Drop your image here
Supports PNG, JPG, BMP, WEBP up to 5MB
Built-In Keywords vs Named Results
The in attribute accepts built-in keywords like SourceGraphic, SourceAlpha, BackgroundImage, and BackgroundAlpha, or it can reference the result of any earlier primitive in the same filter by matching that primitive's result attribute value, giving filter authors full control over how effects chain together.
- Built-in keywords include SourceGraphic, SourceAlpha, and background references
- A named result attribute value lets in reference any earlier primitive's output
- This gives filter authors full control over how effects chain together
Default Behavior When in Is Omitted
If in is omitted on the first primitive in a filter, it defaults to SourceGraphic, but if omitted on any subsequent primitive, it defaults instead to the result of the immediately preceding primitive, making simple linear filter chains readable without needing to name and reference every intermediate result explicitly.
- Omitting in on the first primitive defaults it to SourceGraphic
- Omitting in on later primitives defaults to the immediately preceding result
- This keeps simple linear filter chains readable without naming every step
Frequently Asked Questions
What happens if I omit the in attribute entirely?
The first primitive defaults to SourceGraphic, and every later primitive defaults to using the result of whichever primitive came immediately before it in the filter.
Can in reference a primitive result defined later in the document?
No, in can only reference a result attribute from a primitive defined earlier within the same filter element, not one that appears later in the filter chain.
Related guides
Ready to Convert Your Image to SVG?
Free online converter — no sign-up, no watermarks, results in under 3 seconds.
Try It Free — Convert Image to SVG