October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Browser Image Cropping: Choose a Clip Path or a Mask

Use clip paths for hard-edged image cutouts and masks for fades or partial transparency. Learn when Canvas, CSS, or SVG is the right fit.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use a clip path for a crisp, hard-edged cutout; use a mask when the image needs transparency, a soft fade, or grayscale control. If you are drawing into a canvas already, Canvas 2D clip() fits that pipeline. If the image should stay an HTML or SVG element, CSS clip-path or an SVG clip path is usually the more natural choice.

What is the difference between clipping and masking?

A clip path defines a shape: content inside it remains visible and content outside it is hidden. The result is a hard silhouette, apart from antialiasing along the edge. A mask controls visibility by pixel, allowing intermediate opacity as well as fully visible or hidden areas. That makes masks suitable for soft fades and translucent artwork. The distinction is described in the W3C SVG 1.1 masking and clipping specification.

As an Amazon Associate I earn from qualifying purchases.

In short: clipping answers “inside or outside this shape?”; masking answers “how visible should each part be?”

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Which method should you choose?

  • Circle, polygon, star, or another crisp cutout: use a clip path. Use Canvas clip() if the image is being drawn into a canvas; use CSS clip-path or SVG when it remains an element in the page.
  • Soft edge, fade, or grayscale transparency: use a CSS or SVG mask, choosing alpha or luminance behavior deliberately.
  • Normal HTML structure and interactions: prefer CSS or SVG effects applied to the element rather than drawing it into a canvas. Clipping can also clip clickable areas, so check how it affects links and controls.
  • Generated pixels or an existing canvas rendering pipeline: Canvas clipping is a natural fit because it restricts subsequent drawing. That workflow fit does not mean it is universally faster.

MDN notes that clipping may perform better than masking when a basic shape is all that is needed, and that clipping is easier to interpolate. Treat this as qualitative guidance, not a performance guarantee: there is no universal Canvas-versus-DOM/SVG winner established here, so profile the actual workload in the browsers you support.

#1 Best Overall
Philips 24 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 241V8LB
  • CRISP CLARITY: This 23.8″ Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors
  • WORK SEAMLESSLY: This sleek monitor is virtually bezel-free on three sides, so the screen looks even bigger for the viewer. This minimalistic design also allows for seamless multi-monitor setups that enhance your workflow and boost productivity
  • A BETTER READING EXPERIENCE: For busy office workers, EasyRead mode provides a more paper-like experience for when viewing lengthy documents

How to clip an image on a canvas

Canvas clip() restricts subsequent drawing to the current path, or to a supplied Path2D. A new clip intersects with any existing clipping region. Because clipping changes the canvas drawing state and cannot be directly undone, wrap it in save() and restore().

const ctx = canvas.getContext("2d"" );
ctx.save();
ctx.beginPath();
ctx.arc(100, 100, 80, 0, Math.PI * 2);
ctx.clip();
ctx.drawImage(image, 20, 20, 160, 160);
ctx.restore();

The example clips the drawn image to a circle centered at (100, 100) with a radius of 80 canvas units. Ensure the intended geometry is part of the current path: calling fillRect() draws a rectangle but does not add it to the clipping path. To clip to a rectangle, use rect() after beginPath(), then call clip(). Canvas supports the nonzero fill rule by default and also accepts evenodd.

Rank #2
Philips 22 Inch Computer Monitor FHD 100Hz VA VESA Flicker-Free, 221V8LB
  • CRISP CLARITY: This 22 inch class (21.5″ viewable) Philips V line monitor delivers crisp Full HD 1920x1080 visuals. Enjoy movies, shows and videos with remarkable detail
  • 100HZ FAST REFRESH RATE: 100Hz brings your favorite movies and video games to life. Stream, binge, and play effortlessly
  • SMOOTH ACTION WITH ADAPTIVE-SYNC: Adaptive-Sync technology ensures fluid action sequences and rapid response time. Every frame will be rendered smoothly with crystal clarity and without stutter
  • INCREDIBLE CONTRAST: The VA panel produces brighter whites and deeper blacks. You get true-to-life images and more gradients with 16.7 million colors
  • THE PERFECT VIEW: The 178/178 degree extra wide viewing angle prevents the shifting of colors when viewed from an offset angle, so you always get consistent colors

How to clip an HTML image with CSS or SVG

For an image that should remain an HTML element, CSS clip-path accepts basic shapes and references to SVG <clipPath> elements. For example, a circle can be applied directly in CSS:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
img.avatar {
  clip-path: circle(50% at 50% 50%);
}

SVG effects can also be embedded and referenced from CSS on HTML content. MDN notes that external SVG effect references must be same-origin. See MDN’s guide to applying SVG effects to HTML. If a clipped image contains a link or control, test pointer interaction: the clipped-away area may not remain clickable.

Rank #3
Sale
Dell 24 Monitor - SE2426H - 23.8-inch FHD (1920x1080) 144Hz 1ms Display, in-Plane Switching (IPS) Technology, AMD FreeSync™, TÜV 3-Star 2X HDMI, Tilt
  • Clear visuals. Fluid motion: A 144Hz refresh rate and 1ms MPRT deliver smooth, tear‑free motion across work, gaming, and streaming for clearer, more fluid viewing.
  • Eye comfort: TÜV Rheinland 3‑star* certification reduces harmful blue light while preserving stunning color quality without compromise. *TÜV Rheinland 3-star eye comfort certification.
  • Wide viewing angle: Get consistent views across a wide 178° /178° viewing angle.
  • In-Plane Switching (IPS): See excellent color accuracy and consistency across wide viewing angles with In-plane Switching (IPS) technology.
  • Ultra-thin bezels: Maximize your viewing experience with thin bezels.

When a mask is the right tool

CSS mask-image accepts images, gradients, and SVG mask references. Unlike a clip path, a mask can assign partial visibility, which enables gradient fades and soft transitions. The key choice is whether the mask should use alpha or luminance.

  • Alpha: visibility follows the mask’s alpha transparency.
  • Luminance: visibility follows the mask’s brightness; black and white areas can have different effects even if the SVG appears opaque.

With mask-mode: match-source, ordinary image masks generally use alpha. An SVG <mask> defaults to luminance unless its mask type is set to alpha. Check the intended mode when the result looks faint or inverted. MDN’s mask-image reference documents these behaviors.

Rank #4
Sale
Samsung 27" Essential S3 (S36GD) Series FHD 1800R Curved Computer Monitor
  • CURVED FOR ENHANCED ENGAGEMENT: An immersive viewing experience with a curved monitor that wraps more closely around your field of vision; It creates a wider view, enhancing depth perception and minimizing peripheral distraction
  • SMOOTH PERFORMANCE FOR SEAMLESS CONTENT: Stay in the action when playing games, watching videos, or working on creative projects; The 100Hz refresh rate reduces lag and motion blur so you don't miss a thing in fast-paced moments¹
  • MORE GAMING POWER: Gain the edge with optimizable game settings; Color and image contrast can be adjusted to see scenes more vividly and spot enemies hiding in the dark; Game Mode adjusts any game to fill the screen so you can view every detail²
  • KEEP IT EASY ON THE EYES: Care for your eyes and stay comfortable, even during long sessions; Advanced eye comfort technology certified by TÜV reduces eye strain by minimizing blue light and reducing irritating screen flicker²
  • INCREASED VERSATILITY: Connect to more; Plug devices straight into your monitor for increased flexibility, making your computing environment even more convenient

Troubleshoot blank, faint, tiled, or misaligned results

  • Canvas content is not clipped as expected: confirm that the shape was added to the current path, and that earlier clipping regions are not narrowing the visible area. Use save() and restore() to scope the clip.
  • A CSS-masked element disappears: check that the mask URL loads, the source has nonzero dimensions, and its format and origin are usable. MDN says an empty, failed, missing, or unsupported mask image is treated as transparent black, which reveals nothing.
  • A mask is faint or behaves opposite to expectations: verify whether it uses alpha or luminance, especially for SVG masks.
  • A mask repeats or sits in the wrong place: inspect mask-repeat, mask-size, and mask-position.
  • An external SVG effect fails: check that the SVG resource is same-origin with the HTML document.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Browser support and compatibility

MDN marks Canvas clip() as widely available, established across browsers since July 2015. MDN’s mask-image reference marks the feature widely available since December 2023, while noting that support for some parts varies. Check the compatibility tables for the specific mask features and browser versions in your target matrix before depending on them: Canvas clip() compatibility and mask-image compatibility.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
Sceptre New 22-Inch Gaming Monitor, FHD 1080p, Up to 144Hz, HDMI, DisplayPort, Built-in Speakers, Machine Black (E225W-FW144 Series, 2026)
  • 【INTEGRATED SPEAKERS】Whether you're at work or in the midst of an intense gaming session, our built-in speakers provide rich and seamless audio, all while keeping your desk clutter-free.
  • 【EASY ON THE EYES】 Protect your eyes and enhance your comfort with Blue-Light Shift technology. This feature reduces harmful blue light emissions from your screen, helping to alleviate eye strain during long hours of use and promoting healthier viewing habits.
  • 【WIDEN YOUR PERSPECTIVE】Our sleek minimal bezel design ensures undivided attention. The nearly bezel-free display seamlessly connects in a dual monitor arrangement, delivering an unobstructed view that lets you focus on more at once, completely distraction-free.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.