The Shape of Everything
A website mostly about Mac stuff, written by Gus Mueller
» Acorn
» Retrobatch
» Twitter
» Micro.blog
» Mastodon
» Instagram
» Github
» Maybe Pizza?
» Archives
» Feed
» Micro feed
August 1, 2022

I've started working on Acorn 7.3, and for some reason I got the itch to add a custom convolution filter to it. I've been thinking about adding one for years, and have had some requests for it as well, but it's a bit advanced and maybe not that necessary? But I really wanted it for some reason and it's not a UI change - it's just a filter that's going to be hiding out among the others so you'll never see it unless you want to.

If you want to play along you can do so by grabbing the 7.3 beta from Acorn's latest builds page. The filter is named "Custom Filter" (because that's what Photoshop named its equivalent, and I'm not going to go around renaming stuff just because) and you can find it under the Filter ▸ Misc menu.

The above image is what it looks like when you first add the filter (and you can click on it to view it larger). You'll see a 5 x 5 grid of numbers, with a 1 smack dab in the middle. This is known as the "identity" convolution, which does nothing but let the pixels through unmodified. By the way, I found this painting of a whimsical deer in a short tunnel while recently camping at Larrabee State Park.

Next up I've changed the numbers in the convolution matrix a bit, and all of a sudden the image gets sharper (more noticeable in the larger version). You can also create little blurs by altering the kernel as well (and Acorn comes with some presets for this if you want to play with it).

You can also use convolution kernels for detecting edges.

As well as embossing and making sobel filters.

You can also get a little creative with it by plugging in numbers to see what happens.

Wikipedia has a page on image kernels which goes into detail about what's really going on, and a Google search yields lots more information as well.

The bias field can be used to add to each cell, and the scale value will divide everything by the amount input. For instance, if you're going to apply a 5 x 5 Gaussian blur to this, you'll want to divide everything by 273 (at least with the preset I've added). As long as everything adds up between 0 and 1, you'll be good.