docs(10_Wiki): Dev 폴더 누락분 반영 — Topic_Programming으로 통합

이전 재구성 작업에서 Dev/ 폴더가 누락되었던 것을 반영.

- Dev/Topic_Programming(중첩 폴더, 78개)은 Dev 자체 최상위 폴더들
  (Architecture/Conventions/Engineering_Intelligence 등)과 완전 중복이라 제거.
- Dev 최상위 엔지니어링 지식 폴더(Architecture/Conventions/Engineering_Intelligence/
  Failure_Library/Generalized_Principles/Language/Pattern_Catalog/Platform_Guides/
  Subsystems, 77개)는 이미 Topic_Programming/Topic_Programming에 더 최신 버전이
  존재해 중복 제거(고유 콘텐츠 1개는 예외 처리하여 이동 보존).
- Dev의 W3Schools 언어 튜토리얼 폴더(Topic_C/CPP/CSS/CSharp/HOWTO/HTML/Java/
  JavaScript/PHP/Python/SQL/W3CSS, 1201개)는 전부 Topic_Programming 하위로 이동.
- 에이전트 운영 상태(.astra/docs)는 그대로 유지, 콘텐츠 폴더만 정리.
- Topic_Programming 최종 문서 수: 2784 → 3985.
This commit is contained in:
Antigravity Agent
2026-07-05 00:39:13 +09:00
parent 9148c358d0
commit e9cbf23ab5
1356 changed files with 0 additions and 12831 deletions
@@ -0,0 +1,138 @@
---
id: css-masking-with-svg
title: "CSS Masking with SVG"
category: "Frontend"
status: "draft"
verification_status: "conceptual"
canonical_id: ""
aliases: ["SVG mask", "svg mask element", "mask-image svg", "CSS masking SVG", "svg clip shapes"]
duplicate_of: ""
source_trust_level: "B"
confidence_score: 0.87
created_at: 2026-06-23
updated_at: 2026-06-23
review_reason: ""
merge_history: []
tags: ["css", "web", "frontend", "w3schools", "masking", "svg", "mask-image"]
raw_sources: ["https://www.w3schools.com/css/css3_masking_svg.asp"]
applied_in: []
github_commit: ""
---
# [[CSS Masking with SVG]]
## 🎯 한 줄 통찰 (One-line insight)
An SVG `<mask>` element can act as a mask layer for an image, using SVG shapes (circle, ellipse, polygon) to define which parts of the image are revealed. [S1]
## 🧠 핵심 개념 (Core concepts)
- **SVG mask layer** — an SVG `<mask>` element can serve as the mask layer applied to an image. [S1]
- **Shape-driven** — the visible region is defined by SVG shapes (`<circle>`, `<ellipse>`, `<polygon>`) filled with `#ffffff` inside the mask. [S1]
- **Wiring** — the image references the mask via `mask="url(#svgmask1)"`, where the id matches the `<mask>` element's id. [S1]
## 🧩 추출된 패턴 (Extracted patterns)
- **Define-then-reference** — declare a `<mask id="...">` containing white-filled shapes, then point the `<image>`'s `mask` attribute at `url(#id)`. [S1]
- **Composite masks** — multiple shapes (e.g. several `<circle>`s) inside one `<mask>` reveal multiple regions at once. [S1]
## 📖 세부 내용 (Details)
This page demonstrates how to apply SVG mask layers to images using various SVG shapes. Each example defines an SVG `<mask>` with one or more white-filled (`#ffffff`) shapes, then applies it to an `<image>` via `mask="url(#svgmask1)"`. [S1]
**Circle mask** [S1]
```html
<svg width="600" height="400" xmlns="http://www.w3.org/2000/svg">
<mask id="svgmask1">
<circle r="150" cx="200" cy="200" fill="#ffffff" />
</mask>
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="img_5terre.jpg" mask="url(#svgmask1)"></image>
</svg>
```
**Ellipse mask** [S1]
```html
<svg width="600" height="400" xmlns="http://www.w3.org/2000/svg">
<mask id="svgmask1">
<ellipse cx="220" cy="150" rx="200" ry="100" fill="#ffffff" />
</mask>
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="img_5terre.jpg" mask="url(#svgmask1)"></image>
</svg>
```
**Triangle mask** [S1]
```html
<svg width="600" height="400" xmlns="http://www.w3.org/2000/svg">
<mask id="svgmask1">
<polygon fill="#ffffff" points="200 0, 400 400, 0 400"></polygon>
</mask>
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="img_5terre.jpg" mask="url(#svgmask1)"></image>
</svg>
```
**Star mask** [S1]
```html
<svg width="600" height="400" xmlns="http://www.w3.org/2000/svg">
<mask id="svgmask1">
<polygon fill="#ffffff" points="100,10 40,198 190,78 10,78 160,198"></polygon>
</mask>
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="img_5terre.jpg" mask="url(#svgmask1)"></image>
</svg>
```
**Multiple circles mask** [S1]
```html
<svg width="600" height="400" xmlns="http://www.w3.org/2000/svg">
<mask id="svgmask1">
<circle fill="#ffffff" cx="75" cy="75" r="75"></circle>
<circle fill="#ffffff" cx="80" cy="260" r="75"></circle>
<circle fill="#ffffff" cx="270" cy="160" r="75"></circle>
</mask>
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="img_5terre.jpg" mask="url(#svgmask1)"></image>
</svg>
```
**CSS masking properties reference** [S1]
| Property | Description |
|---|---|
| `mask-clip` | Specifies which area is affected by a mask image |
| `mask-composite` | Specifies a compositing operation used on the current mask layer with the mask layers below it |
| `mask-image` | Specifies an image to be used as a mask layer for an element |
| `mask-mode` | Specifies whether the mask layer image is treated as a luminance mask or as an alpha mask |
| `mask-origin` | Specifies the origin position (the mask position area) of a mask layer image |
| `mask-position` | Sets the starting position of a mask layer image (relative to the mask position area) |
| `mask-repeat` | Specifies how the mask layer image is repeated |
| `mask-size` | Specifies the size of a mask layer image |
| `mask-type` | Specifies whether an SVG `<mask>` element is treated as a luminance mask or as an alpha mask |
## 🛠️ 적용 사례 (Applied in summary)
The page's own examples are the applied cases: SVG `<mask>` layers (circle, ellipse, triangle, star, multiple circles) applied to the `img_5terre.jpg` image. No external project/commit applications found in the source.
## 💻 코드 패턴 (Code patterns)
Reveal a circular region of an image with an SVG mask (language: HTML/SVG):
```html
<svg width="600" height="400" xmlns="http://www.w3.org/2000/svg">
<mask id="svgmask1">
<circle r="150" cx="200" cy="200" fill="#ffffff" />
</mask>
<image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="img_5terre.jpg" mask="url(#svgmask1)"></image>
</svg>
```
## ⚖️ 모순 및 업데이트 (Contradictions & updates)
No contradictions found in the source.
## ✅ 검증 상태 및 신뢰도
- **상태:** draft
- **검증 단계:** conceptual (실제 적용 사례 발견 시 applied/validated로 승격 가능)
- **출처 신뢰도:** B (W3Schools — widely used educational reference, not a primary standards body)
- **신뢰 점수:** 0.87
- **중복 검사 결과:** 신규 생성 (New discovery)
## 🔗 지식 그래프 (Knowledge Graph)
- **상위/루트:** [[CSS Tutorial]]
- **관련 개념:** [[CSS Masking PNG]], [[CSS Masking Gradients]], [[CSS Image Shapes]]
- **참조 맥락:** Referenced when masking an image to arbitrary shapes defined by SVG geometry.
## 📚 출처 (Sources)
- [S1] W3Schools — CSS Masking with SVG — https://www.w3schools.com/css/css3_masking_svg.asp
## 📝 변경 이력 (Change history)
- 2026-06-23: Initial draft synthesized from the W3Schools "CSS Masking with SVG" page (Astra wiki-curation, P-Reinforce v3.1 format).