Files
2nd/10_Wiki/Dev/Topic_CSS/CSS_Masking_SVG.md
T
Antigravity Agent 1cfd3bbb56 docs(10_Wiki): 위키 구조 정리 — 언어 튜토리얼 카테고리 폴더 제거 + 신규 자산 동기화
Topic_CSS/Topic_HTML/Topic_JavaScript/Topic_Prompt/Topic_Comfyui 등 기존 카테고리 폴더를 정리하고,
Topic_Graphic/Dev 등 신규 산출물과 Topics 내부 세션/메모리 기록을 동기화.
2026-07-05 00:10:59 +09:00

6.0 KiB

id, title, category, status, verification_status, canonical_id, aliases, duplicate_of, source_trust_level, confidence_score, created_at, updated_at, review_reason, merge_history, tags, raw_sources, applied_in, github_commit
id title category status verification_status canonical_id aliases duplicate_of source_trust_level confidence_score created_at updated_at review_reason merge_history tags raw_sources applied_in github_commit
css-masking-with-svg CSS Masking with SVG Frontend draft conceptual
SVG mask
svg mask element
mask-image svg
CSS masking SVG
svg clip shapes
B 0.87 2026-06-23 2026-06-23
css
web
frontend
w3schools
masking
svg
mask-image
https://www.w3schools.com/css/css3_masking_svg.asp

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]

<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]

<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]

<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]

<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]

<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):

<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)

📚 출처 (Sources)

📝 변경 이력 (Change history)

  • 2026-06-23: Initial draft synthesized from the W3Schools "CSS Masking with SVG" page (Astra wiki-curation, P-Reinforce v3.1 format).