[magick-users] using clone to avoid writing intermediate output to HD?

Dieter Vanderelst dieter_vanderelst at emailengine.org
Mon Aug 27 06:32:40 PDT 2007


Hi list,

I'm trying to doing the following using IM:

-read in a grayscale image
-perform a difference of gaussians filter
-(optionally: finding the location of the maximum value)
-saving the image

Now I've written this little batch file, which takes 2 parameters (input 
and output images):

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
convert %1 -blur 0x15 blur1.jpg
convert %1 -blur 0x30 blur2.jpg
convert -compose difference blur1.jpg blur2.jpg difference.jpg
convert -normalize difference-0.jpg %2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

As you can see, this script writes some intermediate files to the disk 
and reads them in again. However, after reading the IM documentation I 
think this could be avoided using +clone and Image Stack.

But I'm not sure at all how this would work (I don't quite seem to 
understand the implementation of +clone).

Could someone point out how to rewrite my script such that I does not 
have to write intermediate output to the disk anymore?

[Ah, yes, and I'm also looking for a way to find the location of the 
maximum valued pixel in an image (given that there is one and only one).]

Any help welcome...

Dieter


More information about the Magick-users mailing list