Category Archives: Uncategorized

Makin’ Static in 2017

I’ve decided to dust off my blog for 2017 and I’ve switched away from WordPress to a static website generator, Jekyll… find out more

Adjusting Image Brightness and Color Using the HTML5 Canvas API

filteredEver needed to adjust the brightness of an image? Or maybe you’d like to make an image feel warmer by increasing it’s red channel?

As a followup to my earlier articles, “How You Can Do Cool Image Effects Using HTML5 Canvas” and “How You Can Build an HTML5 Photobooth App“.  In these earlier articles, I provided code for a number of separable color filters: grayscale, sepia, red, brighter, darker.  All of these filters are classified as color filters where the output value for each pixel relies solely on the input state of the same pixel.  It turns out that all of these color filters can all be modeled by a single data driven filter called a Color Matrix Filter which I’ll cover in this article.  This filter takes as input a “color matrix” that contains weights (or coefficients) that determine how the output for a given color component relates to the other color components on input.

Read more »

Essential Canvas For HTML5 Now Available in Alpha

You’d Love to Draw and Animate using the HTML5 Canvas API.  Maybe you want to be able to write an HTML5 game?  Or maybe you want to add image editing to your latest web app?  Or maybe you’ve just heard a lot about the HTML5 Canvas API and want to learn about it?

Interested?  Read More…

Use Node.js to Extract Data from the Web for Fun and Profit


Need to automate pulling some data from a web page? Or want to mash up some unstructured data from a blog post with another data source. No API for getting at the data… !@#$@#$… No Problem… Web scraping to the rescue. What is web scraping?… you may be asking… Web scraping consists of programmatically (typically with no browser involved) retrieving the contents of web pages and extracting data from them.

In this article, I’m going to show you a pretty powerful set of tools for scraping web content quickly and easily using Javascript and Node.js.

Read more »

goo.js – The HTML5 Canvas API Simplified

goopicCheck out my new Javascript library, goo.js.  Goo.js is a microlibrary intended to make it easy to draw and handle mouse and keyboard events with the HTML5 canvas library.  Help out by contributing on GitHub.

  • Easy fullscreen canvas apps with auto resizing
  • Mouse event support
  • Mouse coordinates normalized to canvas coordinates
  • Key event support
  • Animation timer

Demos after the link…

Visit the goo.js project page for more samples, information and source…

Introduction to HTML5 Canvas

canvas_sun_orangeMaybe you’ve heard of the HTML 5 Canvas API, but don’t know what it’s good for…?  Maybe you’ve heard that it’s the way to go if you want to code an HTML5 game? Or maybe you’ve heard that it gives you explicit control over drawing in your browser? So what does all that mean?… Just what is the HTML5 Canvas API?

Let me pull back the curtain a little for you and give you some insight into what the HTML5 Canvas API is all about and what it can do for you and your web apps.

In this article, I’m going to give an introductory overview of the HTML5 Canvas API.  The sample application that comes with this article, “Canvas Playground”, gives a number of canvas drawing examples and even lets you interactively play around with the Canvas API. Give it a try.

Read more »

Complex Animations Using HTML5 Canvas

In my upcoming ebook, “Essential Canvas for HTML5“, you’ll not only learn the basics of animation but you’ll also learn how to do complex Flash-like animations using HTML5 and Javascript that impart dynamics through tweening and other advanced techniques. I’ll break it all down for you and walk you through the source code. Here is just one of the samples that come with the book.

Read more »

How You Can Build an HTML5 Photobooth App


You want the users of your web app to be able to use their webcam to take their own profile shots and you’d like them to be able to personalize or stylize the picture before uploading it your weberver. Or maybe you’ve seen one of those fun photobooth-type apps that takes photos, applies cool image effects to them and lets you share them… wondering how they worked.

Imagine if your HTML5 app could programmatically access your webcam, take snapshots and modify the image data procedurally. You could then let your user’s upload or share their self portraits.

In this article, I’m going to teach you how to do that and more. Building on some articles that I’ve shared in the past, I’ll walk you through a sample application that displays the video from your webcam, applies image processing effects to that video, lets you take still snapshots of the filtered video and lets you serialize the snapshots so that they can be uploaded to a web server.

Read more »

Make Your UI More Responsive with HTML5 Web Workers

HTML5 Web Workers

Argh!!… Your web application has to sort a lot of data and you get the dreaded error message… “A script on this page may be busy, or it may have stopped responding…” Or maybe you’re writing some image processing code that takes forever on large images… Your UI is non-responsive. What are you going to do!!?… You could try to break up the work into small pieces and use timers to spread out the work. But what a PITA!

What if JavaScript had the ability to run your code in the background and not interfere with the responsiveness of your UI. What if you could spawn a thread to do long running computations such as image filtering and sorting. Well with HTML5 Web Workers you can do just that! In the rest of this article, I’m going to teach you how to use Web Workers within your own applications. Click here to try the sample app.

Read more »

How You Can Do Cool Image Effects Using HTML5 Canvas

You need to know how image filters work!  You’re writing an HTML5 application that works with images and you’d like to let your users dynamically alter the brightness of their images. Or maybe you’d like them to be able to give their image a vintage look…. or convert it to black and white to give that sense of drama…

Wouldn’t it be great if you knew how to apply cool image effects such as these from JavaScript dynamically? Would you like to learn the code behind how these image filters work? You totally can… This article will give you the fundamentals for basic image processing using the HTML5 Canvas API. You’ll learn how to write code that accesses an image’s pixel data and transforms this pixel data programmatically to perform cool image effects. Click here to try the sample app.

Read more »