From a357a83860aaac90b37832de066e5a5a016910ea Mon Sep 17 00:00:00 2001 From: memdmp Date: Wed, 25 Mar 2026 12:22:23 +0100 Subject: feat: figured i'd revisit this code i wrote as a shitpost, it seems quite decent actually --- src/routes/playground/canvas/+page.svelte | 54 +++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/routes/playground/canvas/+page.svelte (limited to 'src/routes/playground/canvas/+page.svelte') diff --git a/src/routes/playground/canvas/+page.svelte b/src/routes/playground/canvas/+page.svelte new file mode 100644 index 0000000..04127c1 --- /dev/null +++ b/src/routes/playground/canvas/+page.svelte @@ -0,0 +1,54 @@ + + +

Canvas Playground

+ +

+ Here's some fucking around with the HTML canvas element, initially mostly to + do a funny bit of obscuring images as found in the DOM. +

+ +

Plain Img

+

Normal image tag.

+ +
+ +

CanvasImg

+

+ Simple canvas-based copying of the contents and converting to + blob. Falls back to source image. +

+
+ +

CanvasCopy

+

+ A more involved technique, copying sections of the canvas source and rendering + them in separate image elements, still falling back to source image. +

+

+ Single-pixel artifacts on high-dpi and non-1:1 scaled images can be solved by + creating an overlapping pixel on each edge. This, however, messes up partial + transparency.
+ + +

+
+ +
-- cgit v1.2.3