Stephen Woodbridge on  wrote...
| Hi all,
| 
| I am trying to speed up a simple heatmap image generation:
| 
| 
|      t1 = clock();
| 
|      heatmap = MagickFxImage(heatmap, "v.p{0,u*v.h}");
| 
|      t2 = clock();
|      if (DEBUG) fprintf(stderr, "Time to fx image: %.1f\n",
|              ((double) (t2-t1)) / CLOCKS_PER_SEC);
| 
| This call is taking 68 seconds for a 700x550 image.
| 
|      t1 = clock();
| 
|      sprintf(alphaFX, "A*%.2f", opacity);
|      heatmap = MagickFxImageChannel(heatmap, AlphaChannel, alphaFX);
| 
|      t2 = clock();
|      if (DEBUG) fprintf(stderr, "Time to fx Alpha image: %.1f\n",
|              ((double) (t2-t1)) / CLOCKS_PER_SEC);
| 
| and this call is taking 8.2 sec.
| 
| is there a better (faster) way to do this? This represents about 99% of 
| the time to process the image :(
| 
| Another annoying problem I ran into is the fact that the first Fx call 
| would not even work until I saved the heatmap image to a file and 
| reloaded the file. is there a better way to materialize the image so the 
| Fx command will work on it?
| 
The two images should be in the same Wand for the FX function to work.

and yes FX is slow, because it is interpreted.  If you want to do it
faster you can do the lookup yourself in the API you are using.
That will make it a couple of orders of magnitude faster.

Actually color lookup tables such as you are doing is actually quite a
standard FX function, and probably should be made into a built in.
Though the actual syntax both in the Core function and commandline API
has not been worked out.


  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
    "It's a shame that you do not like what you have created!"
                         --- Jobe -- "The Lawnmower Man" - Steven King
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to