An App for Creating Digital Art

The computer is my assistant

Stuart Smith
Artique
4 min readApr 27, 2023

--

I’m going to describe an app I wrote to help me make digital art. The app’s main function is about 3000 lines of Matlab code. There are also about 350 supporting functions, most of which are just a few lines of code.

The app works by applying various filters to source images. Currently there are 45 different filters. Any number of filters can be applied in any order, and repeats of filters are allowed. Here is an image created by applying a sequence of filters to a photograph of an urban scene:

Image by Author.

A source image can be computer generated, or it can be a painting, drawing, photograph, or any other kind of image. The app can also generate several kinds of source images by itself. Here are two source images generated by the app:

Images by Author.

I chose to implement the app in Matlab for three reasons. First, the “mat” in Matlab stands for “matrix,” a two-dimensional array of data. Since images can be represented as matrices, you can take advantage of the matrix operations built into Matlab, such as adding two matrices, taking their difference, multiplying a matrix by a constant, blending two images according to some formula, and so on. This greatly simplifies the coding of filters.

The second reason is that there are many helpful “toolboxes” that add to Matlab specialized capabilities that are very useful in creating digital art. I use six of the toolboxes:

· Image Processing, the most important one for my work

· Signal Processing

· Digital Signal Processing

· Communications

· Audio Systems

· Wavelet

Finally, the third reason I use Matlab is its built-in “App Designer.” This is a tool that lets you create a graphical user interface entirely with drag-and-drop. I didn’t write a single line of code to create the user interface to my app.

The App Designer generates the object-oriented code needed to build a graphical user interface. I wrote all the code underneath the interface — the code that actually computes something.

The app has 32 “presets,” canned programs that allow you to select a sequence of filters with a single mouse click. Each preset is essentially a “theme” on which the app generates “variations.” Here is an example generated according to the app’s Preset 24, which produces these flowing, floral-like images:

Image by Author.

The app can assign an “aesthetic score” to each image it generates. The lower the score the higher the (presumed) quality of the image. Images with aesthetic scores between 1 and 2 are generally the best according to my taste.

You can set a threshold aesthetic score, above which the app will simply throw an image out. This capability is useful when making a long run of images; it can spare you the time and effort that would otherwise be required to wade through a large number of unacceptable images.

A useful feature of the app is its ability to “borrow” the palette from another image. The following image was generated by the app in gray scale but it uses the palette borrowed from Picasso’s Girl Before a Mirror. No object content is copied from the painting; only the color scheme is transferred to the computed image.

Image by Author.

The next image was produced by a Preset that generates swirling images with a rougher texture.

Image by Author.

The next image was generated by a Preset that produces colored lobes that spring out from one corner of the image. The number, sizes, and colors of the lobes are all determined by random values computed by the preset itself.

Image by Author.

The final image was generated by a Preset that twists the source image counterclockwise and distorts the shapes in the image. The amount of twist and the amount of distortion are both determined by random values computed by the preset itself.

Image by Author.

The app can generate many other kinds of images with just the current 32 Presets. Since the app is a work-in-progress additional Presets will be added as they are developed. Of course, there is no requirement to use Presets at all. Experimenting with new sequences of filters and new source images may be the most enjoyable aspect of using the app.

--

--

Stuart Smith
Artique
Writer for

Stuart Smith is professor emeritus in the departments of Music and Computer Science at the University of Massachusetts Lowell. He develops apps for digital art.