<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/html5-canvas-and-globalcompositeoperation-af91jrbpf" -->

---
title: HTML5 Canvas and globalCompositeOperation | daily.dev
description: A 2010 demo exploring HTML5 Canvas&#x27;s globalCompositeOperation property to build a scratch-off effect. Covers how different composite modes like &#x27;source-over&#x27;,...
canonical: https://daily.dev/posts/html5-canvas-and-globalcompositeoperation-af91jrbpf
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: HTML5 Canvas and globalCompositeOperation | daily.dev
og:description: A 2010 demo exploring HTML5 Canvas&#x27;s globalCompositeOperation property to build a scratch-off effect. Covers how different composite modes like &#x27;source-over&#x27;,...
og:url: https://daily.dev/posts/html5-canvas-and-globalcompositeoperation-af91jrbpf
og:image: https://api.daily.dev/og/posts/af91jrBpf.png
og:image:alt: HTML5 Canvas and globalCompositeOperation
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# HTML5 Canvas and globalCompositeOperation

**[Beej's Blog](https://daily.dev/sources/beej)** · 2 min read · 0 upvotes · 0 comments

## Summary

A 2010 demo exploring HTML5 Canvas's globalCompositeOperation property to build a scratch-off effect. Covers how different composite modes like 'source-over', 'source-atop', and 'source-out' affect how drawing operations interact with existing canvas content. Notes browser compatibility issues with 'source-out' in Firefox, and briefly mentions an alternative approach using clip() for masking.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <http://beej.us/blog/data/html5-canvas-globalcompositeoperation/>

## Similar posts on daily.dev

- [The Web Is Fun Again: First Experiments with HTML in Canvas – Frontend Masters Blog](https://daily.dev/posts/the-web-is-fun-again-first-experiments-with-html-in-canvas-frontend-masters-blog-n0q3syc0y) · Frontend Masters · 3 upvotes · 0 comments
- [Exploring the HTML-in-Canvas Proposal](https://daily.dev/posts/exploring-the-html-in-canvas-proposal-62dkmwqtx) · Codrops · 2 upvotes · 0 comments
- [Canvas UI Ships 35 HTML-in-Canvas Components That Run WebGL and WebGPU Effects Over Live DOM](https://daily.dev/posts/canvas-ui-ships-35-html-in-canvas-components-that-run-webgl-and-webgpu-effects-over-live-dom-tfekmd60e) · InfoQ · 0 upvotes · 0 comments

---

Tags: [#webdev](https://daily.dev/tags/webdev), [#javascript](https://daily.dev/tags/javascript)

[View this post on daily.dev](https://daily.dev/posts/html5-canvas-and-globalcompositeoperation-af91jrbpf)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"HTML5 Canvas and globalCompositeOperation","url":"https://daily.dev/posts/html5-canvas-and-globalcompositeoperation-af91jrbpf","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/html5-canvas-and-globalcompositeoperation-af91jrbpf"},"datePublished":"2026-03-31T12:28:02.737Z","dateModified":"2026-03-31T12:40:33.731Z","description":"A 2010 demo exploring HTML5 Canvas's globalCompositeOperation property to build a scratch-off effect. Covers how different composite modes like 'source-over',...","image":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","thumbnailUrl":"https://media.daily.dev/image/upload/s--HRgLpUt6--/f_auto/v1722860399/public/Placeholder%2003","isAccessibleForFree":true,"articleSection":"Beej's Blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Beej's Blog","logo":"https://media.daily.dev/image/upload/logos/placeholder.jpg","url":"https://daily.dev/sources/beej"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/html5-canvas-and-globalcompositeoperation-af91jrbpf","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"webdev,javascript","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Beej's Blog","item":"https://daily.dev/sources/beej"},{"@type":"ListItem","position":3,"name":"HTML5 Canvas and globalCompositeOperation"}]}
```

