NWA-PCUG Newsletter Article, June 2012
Euphoric DigiDaub, Revision 7
By David Pletts,
Member at Large in the UK, SWIPCC
(Southwest International PC Club), Texas March 2012 issue, Throughput

http://www.swipcc.org
gh6539 (at) sbcglobal.net (click to email author)

I'm really into textures. They are all around us; some quite formal and repetitive, bordering on patterns, others, especially natural ones, very random. Some textures are fractal in nature, but that's a whole subject in itself.

I also like abstract art - well, some of it, at least.

I am also rather keen on randomness. Computers are good at randomness, better, I believe, than humans, especially as programming languages include sophisticated algorithms to produce random numbers.

These interests in combination with an interest in computer programming, especially programming graphics, have resulted in the creation of DigiDaub. I started down the route to DigiDaub by programming textures only at first, using the Euphoria programming language, of which more, later. That was in 1997 when some of us were still using good old DOS. Later, I did something similar in Windows 3.1, using Visual Basic 4, but eventually returned to Euphoria for further development of the idea. I decided that it might be fun to include shapes as well as textures, include plenty of randomness, and create a program to generate abstract art. Thus a predecessor of DigiDaub, known as AmbiDaub was born. Eventually I hit on the name DigiDaub, and DigiDaub was born.

I have to admit that not all algorithms included in DigiDaub are my own; some have been adapted from code in books and on the internet. So how does DigiDaub work?

First of all there are a number of Canvases to choose from. All 'painting' is, naturally, restricted to the Canvas. The choice of colours then needs to be considered. When DigiDaub first starts it creates a sequence of blended colours, a palette. Methods of generating palettes are provided, some predefined palettes are also provided, and a single key press will generate a new random palette. Palettes can be saved and reloaded.

Menus provide access to a number of design features including textures, regular textures, geometric and organic shapes plus effects. Almost every one of these features includes a random element, either of colour, shape, position or a combination of these elements. The ultimate generative feature is the ability of DigiDaub to create a stream of images, each building on the previous one, which are entirely random. Design elements are randomly picked from most of the elements available via the menus. As each element or effect is added, DigiDaub automatically saves the image on disk, The selection of design elements is restricted as appropriate when rendering an energy field, an organic or a geometric image which are available from the Auto menu. A roundel feature is also available which generates circular patterns.

A new feature in DigiDaub 7 is the addition of randomly chosen text in randomly chosen styles using the fonts installed on your computer. A file of text material is provided, but you can load your own selection of words or phrases from your own text file.

You can copy an image from the canvas, then include it in a new canvas in various ways; blended at three strengths, reveal parts of the copied image or have parts of the image show through.

You can import your own images for further processing, by adding design features to it or applying effects. You can also blend or overlay an imported image with the current canvas so as add a photo, for example, or other ready-made image to the canvas. This allows you to incorporate a touch of realism in your abstract image. Naturally any images you make can be saved either as .bmp files or one of three levels of compression in a .jpg file.

Textures and effects are not intended to replace software dedicated to those particular activities but are included to enhance the abstract nature of images produced by DigiDaub.

DigiDaub7 can be downloaded from http://www.box.com/s/k69b2qgfhd8hr2hijt0q

Example DD7 image with blended image:

Euphoria
I am a programmer of only moderate ability. I started programming when many computers came with a version of the BASIC programming language provided, or in-built. Eventually I moved to programming with Turbo Pascal with which I was very comfortable, until Object Orientated Programming (OOP) was introduced. Although I understand OOP - just - I find that it doesn't suit me as it seems to add a layer of complexity which I can do without. Regrettably it seems that today the main-stream programming languages include it. At about the same time MS Windows became the almost de facto PC operating system which just added another layer of complication for a programmer of my limited ability.

Then I discovered the Euphoria programming language, fundamentally a DOS and LINUX based language. Over time many programming libraries have been made available to the Euphoria programmer including an excellent MS Windows dynamic link library (DLL) which provides easy access to most MS Windows features. The RapidEuphoria archive contains very many example programs, routines and libraries which are freely available. In fact Euphoria itself is also free to use.

I soon found Euphoria greatly to my liking. It has all the usual programming characteristics such as variables, looping methods, if...then..else constructions, expressions, relational, logical and arithmetical operations, procedures and functions. Variables have to be declared as either an atom or a sequence, with a special version of an atom - an integer. These are all considered objects. An object can be any of these variable types and can be tested to see which type of variable it is. The sequence is a special type of what would be considered an array in other languages. It's size does not have to be declared and can vary between just one item to a huge number of items. The size can also be increased or decreased on the fly. A sequence can consist of another sequence or an atom/integer, or a mixture of both. Strings are simply stored as a sequence (remember that characters are actually represented in computers as numbers.)

I make good use of sequences in DigiDaub, especially when it comes to building a palette of colours. The palette is stored in a sequence as a list of numbers. Colours can be added way beyond a useful quantity but reduced to just a single colour very easily with some very simple programming. Sequences are also used to gather coordinates for drawing polygons and recording the DigiDaub composites. A number of operations on sequences are included in Euphoria, making the sequence almost infinitely flexible. As the information provided with Euphoria says:

"By basing Euphoria on this one, simple, general, recursive data structure, a tremendous amount of the complexity normally found in programming languages has been avoided. The arrays, structures, unions, arrays of records, multidimensional arrays, etc. of other languages can all be easily represented in Euphoria with sequences. So can higher-level structures such as lists, stacks, queues, trees etc."

A basic programmer's editor is provided with Euphoria, but I prefer to use an alternative, downloaded from the Euphoria Archive.

Euphoria programs can be easily converted to executable files (.exe).

I use version 3.1.1. A version 4 is available, but I am not conversant with it, and not too happy with what I have seen so far.

Here is an example of the famous "Hello World" program in Euphoria for Windows:
________________________________________________
-- This example opens a window, and places the text
-- "Hello World!" in it.
without warning
include win32lib.ew
-- Create a window
createForm({
"My First Message", -- Window title
"Hello World!" -- Put some text in it
})
include w32Start.ew
________________________________________________

Euphoria is extremely well documented, much easier to use than recent modern programs, is well supported and has a large user-base with an archive full of generous helpings of examples and utilities. I don't know if there is anything you couldn't program in Euphoria. You may have guessed by now that I'm really keen on Euphoria, but I have no other connection with Euphoria except as a happy user.

Euphoria can be found at http://www.rapideuphoria.com

Click here to return to top



==================================================================