[ANN]: Image-Filter Demo

Wilhelm Sanke sanke at hrz.uni-kassel.de
Tue Apr 25 18:35:52 EDT 2006


 From <http://www.sanke.org/Software/ImageFilterDemo.zip> or page 
"Sample Stacks" of <http://www.sanke.org/MetaMedia> you can download a 
fully functional imagedata-handling stack. It is a *demo* only in so far 
as the number of options is restricted. Some functions require the 
accompanying "external.dll", but most can be used on any platform.

The main purpose of this stack is to provide a limited preview of my 
forthcoming "ImageData Toolkit", which will be organized like the 
"Colorpattern Toolkit" (see my website <www.sanke.org/MetaMedia>), but 
unlike it has the added possibilities to manipulate image and photo data 
- not only just "color chars" in a field like with the "Colorpattern 
Toolkit".

Preparing the "Imagedata Toolkit" I revisited Chipp Walters's stack 
"altconvolve2" (<www.altuit.com>), where he shows how to integrate 
matrix filters for image manipulation into Revolution/Metacard. He uses 
two approaches in his stack: One is using an external ("external.dll") 
that was compiled from material assembled by Scott Raney (the creator of 
Metacard, and thus, the person who laid the foundations on which 
Revolution eventually could begin its development) - the material is 
still available at <ftp.metacard.com>. On the other hand, Chipp 
demonstrated that it is indeed possible to script such filter functions 
solely using Transcript (and now "Revolution").
His excellent example provided me with a first insight how such filter 
functions can be put into practice.

We had an exchange about stack "altconvolve" offlist, concentrating on 
two aspects:

1. Using the DLL (of 2002) causes a color shift towards yellow, because 
the imagedata format changed after Metacard version 2.4, but the 
execution of the filter functions with the DLL is lightning fast.

2. Using the no-external approach totally scripted in Revolution takes 
its time, i.e. it is somewhat slow for practical purposes as even on 
medium-fast 2 GHz machines it takes about 90 seconds to execute.

To eliminate the color shift when using the DLL, I added correctional 
"filters" to that script. Execution time is about 2.5 seconds, so it is 
indeed "usable". As Chipp informed me, a new DLL with much extended 
features is in the works, but not yet ready for release at the moment.

Concerning the "no-external" approach I proposed to substitute the use 
of arrays in his script with direct references to the imagedata involved 
to improve the speed of the script, which is implemented in the 
"adapted" version of the "Apply filter.." button of my stack.

It depends very much on the context, whether the use of arrays may speed 
up or slow down script execution. The "wordcount" script - to be found 
under menu item "Help" and "Examples" of the Metacard IDE - is an 
example for the use of arrays improving the compiling of a list of 
unique words (and its occurrences) of a text file with a really amazing 
speed that otherwise would have been cumbersome to script and slow to 
execute without arrays.

In the case of the "no-external" script leaving out the arrays - which 
nevertheless have their value for better understanding of the script - 
here improves the speed considerably. I implemented my proposal to leave 
out the arrays - compare the script of the "adapted" button on the left 
- which reduces the average execution speed to 10 seconds instead of 90.--

The rest of my stack is similar to my "Colorpattern Toolkit". There are 
some sample images which you can use to experiment with the various 
filters and other functions, you can also import (and save) images for 
manipulation.
Two buttons offer an option to create random color patterns for further 
manipulation.
There are *two" images on top of the other to provide the possibility to 
*mix" two pictures in various ways.

I have chosen 21 examples of filter functions (that will also be 
contained in the "Imagedata Toolkit") that do *not* use externals or a 
convential "matrix". The scripts of most of these examples are 
accessible. There are additional examples with mirrors and  for changing 
the spatial structure of images.

I have not included a detailed description or tutorial. Enjoy to 
experiment with this demo stack - in case you like this kind of stuff.

Wilhelm Sanke
April 2006




More information about the use-livecode mailing list