<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Canvas on JsonKit Blog</title>
    <link>https://jsokit.com/blog/tags/canvas/</link>
    <description>Recent content in Canvas on JsonKit Blog</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>© 2025 JsonKit</copyright>
    <lastBuildDate>Mon, 11 May 2026 15:05:34 +0000</lastBuildDate>
    <atom:link href="https://jsokit.com/blog/tags/canvas/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Browser-Based Web Screenshots: From getDisplayMedia API to Canvas Implementation</title>
      <link>https://jsokit.com/blog/posts/browser-based-web-screenshots-from-getdisplaymedia-api-to-canvas-implementation/</link>
      <pubDate>Mon, 11 May 2026 15:05:34 +0000</pubDate>
      <guid>https://jsokit.com/blog/posts/browser-based-web-screenshots-from-getdisplaymedia-api-to-canvas-implementation/</guid>
      <description>Browser-Based Web Screenshots: From getDisplayMedia API to Canvas Implementation I recently built a web screenshot tool, thinking it&amp;rsquo;d be straightforward. Spoiler: I hit several gotchas. Here&amp;rsquo;s what I learned, in case you&amp;rsquo;re tackling the same problem.&#xA;Choosing a Screenshot Approach There are three common approaches for web screenshots:&#xA;Server-side - Use Puppeteer/Playwright to render and capture on the server html2canvas - Frontend library that converts DOM to Canvas getDisplayMedia API - Native browser screen capture API Each has trade-offs:</description>
    </item>
    <item>
      <title>From Reed-Solomon to Canvas: Building a High-Quality QR Code Generator</title>
      <link>https://jsokit.com/blog/posts/from-reed-solomon-to-canvas-building-a-high-quality-qr-code-generator/</link>
      <pubDate>Fri, 24 Apr 2026 15:29:48 +0000</pubDate>
      <guid>https://jsokit.com/blog/posts/from-reed-solomon-to-canvas-building-a-high-quality-qr-code-generator/</guid>
      <description>From Reed-Solomon to Canvas: Building a High-Quality QR Code Generator A recent project required &amp;ldquo;nicer looking&amp;rdquo; QR codes. Most tools I found just produced black-and-white squares or slapped a logo on top. I wanted something more refined, so I dug into QR code internals.&#xA;QR Code: More Than Black and White QR Code (Quick Response Code) was invented by Denso Wave in 1994. A QR Code contains:&#xA;Position Markers: Three corner squares for orientation Timing Patterns: Alternating black/white lines for alignment Version Info: QR code size (versions 1-40) Format Info: Error correction level and mask pattern Data Area: Actual content The key is Reed-Solomon error correction.</description>
    </item>
    <item>
      <title>Building a Placeholder Image Generator with Canvas API: From Basics to Performance</title>
      <link>https://jsokit.com/blog/posts/building-a-placeholder-image-generator-with-canvas-api-from-basics-to-performance/</link>
      <pubDate>Wed, 22 Apr 2026 17:56:14 +0000</pubDate>
      <guid>https://jsokit.com/blog/posts/building-a-placeholder-image-generator-with-canvas-api-from-basics-to-performance/</guid>
      <description>Building a Placeholder Image Generator with Canvas API: From Basics to Performance As a frontend developer, I often need placeholder images: design assets aren&amp;rsquo;t ready, images are missing, or I&amp;rsquo;m building a quick prototype. I used to rely on services like placehold.co or picsum.photos, but network issues or specific style requirements led me to build my own.&#xA;Canvas API Basics The core is the Canvas API. Here&amp;rsquo;s the simplest implementation:</description>
    </item>
    <item>
      <title>Placeholder Image Generator: From Canvas API to Smart Layout Implementation</title>
      <link>https://jsokit.com/blog/posts/placeholder-image-generator-from-canvas-api-to-smart-layout-implementation/</link>
      <pubDate>Sun, 12 Apr 2026 16:20:53 +0000</pubDate>
      <guid>https://jsokit.com/blog/posts/placeholder-image-generator-from-canvas-api-to-smart-layout-implementation/</guid>
      <description>Placeholder Image Generator: From Canvas API to Smart Layout Implementation When developing new features or designing prototypes, we often need placeholder images to fill areas where real images aren&amp;rsquo;t ready yet. Instead of hunting for images on Unsplash every time, why not build your own placeholder image generator? This article dives deep into the implementation details, covering Canvas binding, adaptive font sizing, grid backgrounds, and more.&#xA;Why Build a Placeholder Image Generator?</description>
    </item>
    <item>
      <title>Canvas Image Watermark Implementation: From Positioning to Tiled Patterns</title>
      <link>https://jsokit.com/blog/posts/canvas-image-watermark-implementation-from-positioning-to-tiled-patterns/</link>
      <pubDate>Fri, 27 Feb 2026 11:13:45 +0000</pubDate>
      <guid>https://jsokit.com/blog/posts/canvas-image-watermark-implementation-from-positioning-to-tiled-patterns/</guid>
      <description>Canvas Image Watermark Implementation: From Positioning to Tiled Patterns Adding watermarks to images is a common requirement—copyright protection, brand visibility, you name it. Recently built an online watermark tool, and here&amp;rsquo;s how it works under the hood.&#xA;The Essence of Watermarks It boils down to layering semi-transparent text or graphics over an image. Core code:&#xA;const canvas = document.createElement(&amp;#39;canvas&amp;#39;) const ctx = canvas.getContext(&amp;#39;2d&amp;#39;) ctx.drawImage(img, 0, 0) // Draw original image first ctx.</description>
    </item>
    <item>
      <title>Image to Sketch: Gaussian Blur and Color Dodge Blending with Canvas</title>
      <link>https://jsokit.com/blog/posts/image-to-sketch-gaussian-blur-and-color-dodge-blending-with-canvas/</link>
      <pubDate>Wed, 25 Feb 2026 14:21:49 +0000</pubDate>
      <guid>https://jsokit.com/blog/posts/image-to-sketch-gaussian-blur-and-color-dodge-blending-with-canvas/</guid>
      <description>Image to Sketch: Gaussian Blur and Color Dodge Blending with Canvas I was building an image processing toolkit and needed to convert photos into pencil sketch style. After some research, I found the core principle is surprisingly simple: it&amp;rsquo;s all about combining Gaussian blur with color dodge blending.&#xA;The Theory Behind Sketch Effect What characterizes a traditional pencil sketch? Clear lines, strong contrast, white background. In digital image processing, edge detection methods like Sobel operator or Canny algorithm are common.</description>
    </item>
    <item>
      <title>Canvas Transform Matrix for Image Rotation: From translate/rotate to Operation Queues</title>
      <link>https://jsokit.com/blog/posts/canvas-transform-matrix-for-image-rotation-from-translaterotate-to-operation-queues/</link>
      <pubDate>Tue, 24 Feb 2026 16:19:16 +0000</pubDate>
      <guid>https://jsokit.com/blog/posts/canvas-transform-matrix-for-image-rotation-from-translaterotate-to-operation-queues/</guid>
      <description>Canvas Transform Matrix for Image Rotation: From translate/rotate to Operation Queues Recently I worked on a feature where users upload images and can rotate or flip them, combining multiple operations. For example: rotate 90° clockwise, flip horizontally, then rotate 90° again. Sounds simple, but I hit several gotchas during implementation.&#xA;The Essence of Canvas Transforms Canvas 2D context provides three transform methods:&#xA;ctx.translate(x, y) // Translation ctx.rotate(angle) // Rotation (radians) ctx.</description>
    </item>
    <item>
      <title>Image Resize Tool Implementation: From Canvas API to High-Quality Scaling Algorithms</title>
      <link>https://jsokit.com/blog/posts/image-resize-tool-implementation-from-canvas-api-to-high-quality-scaling-algorithms/</link>
      <pubDate>Tue, 24 Feb 2026 15:19:16 +0000</pubDate>
      <guid>https://jsokit.com/blog/posts/image-resize-tool-implementation-from-canvas-api-to-high-quality-scaling-algorithms/</guid>
      <description>Image Resize Tool Implementation: From Canvas API to High-Quality Scaling Algorithms Written: 2026-05-09 17:22&#xA;Image resizing is a deceptively complex task in web development. Whether you&amp;rsquo;re handling avatar uploads, generating thumbnails, or adapting images for different device displays, the underlying browser rendering mechanics are more nuanced than they appear. Let&amp;rsquo;s dive into building a high-performance online image resize tool.&#xA;How Canvas API Works Under the Hood The browser&amp;rsquo;s image processing backbone is the &amp;lt;canvas&amp;gt; element, which provides a 2D rendering context (CanvasRenderingContext2D).</description>
    </item>
    <item>
      <title>Canvas Image Pixelation: The Two-Step Scale Down and Scale Up Approach</title>
      <link>https://jsokit.com/blog/posts/canvas-image-pixelation-the-two-step-scale-down-and-scale-up-approach/</link>
      <pubDate>Mon, 23 Feb 2026 19:55:42 +0000</pubDate>
      <guid>https://jsokit.com/blog/posts/canvas-image-pixelation-the-two-step-scale-down-and-scale-up-approach/</guid>
      <description>Canvas Image Pixelation: The Two-Step Scale Down and Scale Up Approach Recently, while building an image pixelation tool, I discovered something interesting: many implementations manually iterate through each pixel block to calculate average colors. That works, but there&amp;rsquo;s a more elegant approach—leveraging Canvas scaling behavior.&#xA;What is Pixelation? Pixelation is an image processing technique that reduces resolution to hide details. Essentially, you divide an image into blocks and fill each block with a single color.</description>
    </item>
    <item>
      <title>Image Optimizer Deep Dive: From Canvas API to Intelligent Compression Algorithms</title>
      <link>https://jsokit.com/blog/posts/image-optimizer-deep-dive-from-canvas-api-to-intelligent-compression-algorithms/</link>
      <pubDate>Mon, 23 Feb 2026 17:55:42 +0000</pubDate>
      <guid>https://jsokit.com/blog/posts/image-optimizer-deep-dive-from-canvas-api-to-intelligent-compression-algorithms/</guid>
      <description>Image Optimizer Deep Dive: From Canvas API to Intelligent Compression Algorithms Published: May 8, 2026 03:48&#xA;In web development, image optimization is a critical aspect of performance tuning. According to HTTP Archive statistics, images account for more than 50% of the average webpage&amp;rsquo;s total size. Today, let&amp;rsquo;s explore how to implement an efficient image optimizer, from the underlying principles of Canvas API to intelligent compression algorithm design.&#xA;Canvas API: The Browser&amp;rsquo;s Image Processing Engine Modern browsers provide powerful image processing capabilities through the Canvas API, primarily using the 2D rendering context for pixel-level operations:</description>
    </item>
  </channel>
</rss>
