First image processing try with Processing.js

Processing is a famous language for Digital Artists and Makers. It is based on Java, but now Javascript is also supported by the regular Processing IDE. It is using the canvas element from HTML5, and most of the Java code was ported to run in Javascript only.

I tried a quick example.

In this example I am switching the Red and Blue channels of a picture, and also applying a sharpening filter on the Green channel.

Sharpening is done using this high pass filter :

float v = 1.0 / 8.0;
float sharp = 2;
float kernel = {{ -sharp*v, -sharp*v, -sharp*v },
{ -sharp*v, +sharp+1, -sharp*v },
{ -sharp*v, -sharp*v, -sharp*v }};

Check the results here. Image processing will be done by your web browser, so it is a little bit slow. 🙂

Source code is here.

I was pleased to see how easy it is to work with Processing, so I plan to implement the basic image processing algorithms and functions. I believe Processing.js is a great way to write educational applets about Image Processing.

Tags: ,

First image processing try with Processing.js

2 Responses

  1. I am definitely going to give this a shot. Great article.

    Fatal error: Uncaught Error: Call to undefined function ereg_replace() in /home/users3/g/gaeljaffrain/www/gaeljaffrain/wp-content/themes/theonepager/includes/theme-comments.php:64 Stack trace: #0 /home/users3/g/gaeljaffrain/www/gaeljaffrain/wp-content/themes/theonepager/includes/theme-comments.php(28): the_commenter_link() #1 /home/users3/g/gaeljaffrain/www/gaeljaffrain/wp-includes/class-walker-comment.php(179): custom_comment(Object(WP_Comment), Array, 1) #2 /home/users3/g/gaeljaffrain/www/gaeljaffrain/wp-includes/class-wp-walker.php(145): Walker_Comment->start_el('', Object(WP_Comment), 1, Array) #3 /home/users3/g/gaeljaffrain/www/gaeljaffrain/wp-includes/class-walker-comment.php(139): Walker->display_element(Object(WP_Comment), Array, '5', 0, Array, '') #4 /home/users3/g/gaeljaffrain/www/gaeljaffrain/wp-includes/class-wp-walker.php(387): Walker_Comment->display_element(Object(WP_Comment), Array, '5', 0, Array, '') #5 /home/users3/g/gaeljaffrain/www/gaeljaffrain/wp-includes/comment-template.php(2174): Walker->paged_walk in /home/users3/g/gaeljaffrain/www/gaeljaffrain/wp-content/themes/theonepager/includes/theme-comments.php on line 64