In this post I will explore image editing using convolution matrices in JavaScript using the JIMP library.
Continue reading
In this post I will explore image editing using convolution matrices in JavaScript using the JIMP library.
Continue reading
Another post using the JIMP npm package, this time experimenting with several methods for comparing images to find duplication or plagiarism.
Continue reading
One of the JIMP library's many features is the ability to create a Base 64 string from an image. This has various uses (some nefarious...) but in this post I will demonstrate embedding a Base 64 encoded graphic as an image source in an HTML document. This is useful for small images such as logos or button graphics, and while I am using HTML the Base 64 string can also be used in CSS.
Continue reading
I have used JIMP - the JavaScript Image Manipulation Program - in a couple of previous posts and here I will use it for what may be its most common use case, processing images uploaded to a Node-based website.
Continue reading
In a few previous posts I have used the excellent math.js library which provides a flexible and extensive range of functionality to complement JavaScript's own Math object. This includes a wider selection of trigonometric functions than Math and in this post I will use them to provide a crash course in trigonometry.
Continue reading
You may have seen tiny line graphs embedded in tables of data. They are called sparklines and in this post I will write some simple code to create them as SVG images from an array of data and insert them into an HTML element.
Continue reading
Dates and times are less than straightforward to deal with, partly because of the varying sizes of the units which don't often fit neatly into the larger units, and partly because of the almost infinite number of ways they can be expressed in natural language.
Programming languages usually provide robust ways of handling dates and in this article I will put together a solution providing a reference to JavaScript's core date handling functionality.
Continue reading
The map data type is simple to understand and use but the topic can cause confusion due to the wide variety of names used to refer to the same thing. On top of that JavaScript did not have its own map type until ES6 came along so we had to improvise with an ordinary Object.
In this post I will run through what a map is before using both an Object and an ES6 Map.
Continue reading
Adding a large number of event handlers to a page has an adverse affect on performance and a common technique for alleviating this problem is known as event delegation where we add a single event handler to a parent element somewhere up the heirarchy. This works due to the flow of events through the DOM, and I put the technique to good use in my Interactive Periodic Table. In this post I will demonstrate event delegation using a simplified version of the Periodic Table.
Continue reading
HTML5 gave us the ability to add arbritrary pieces of information to any element to use behind the scenes for any purpose you wish. These are known as data attributes and I put them to good use in my Interactive Periodic Table. There is plenty of information around on the topic but often with simplistic or contrived examples so here I will present a real-world usage with a simplified version of the Periodic Table.
Continue reading