Speed optimization (ReadBlob + Gamma)
Posted: 2007-09-26T08:19:33-07:00
Hi,
I'm doing something like this:
Now this works fine but it seems awfully slow.
Is there a good way to optimize this?
I read about the Pixel Cache stuff and thought things would get faster when allocating one PixelCache once and then re-use that one for every image. But i guess using MagickCore functions isn't a good idea. I don't even know what exactly takes so long in the above code. I first wanted to ask here before I begin profiling half the ImageMagick code :)
thanks for any suggestions
regards
I'm doing something like this:
Code: Select all
magick_wand = NewMagickWand();
while(my_image) {
MagickReadImageBlob(magick_wand, my_image->data, my_image->datasize);
MagickGammaImageChannel(magick_wand, RedChannel, gamma_r);
MagickGammaImageChannel(magick_wand, GreenChannel, gamma_g);
MagickGammaImageChannel(magick_wand, BlueChannel, gamma_b);
MagickGetImagePixels(magick_wand,0, 0,width,height, "RGB", CharPixel,
my_image->raw_data);
MagickRemoveImage(magick_wand);
my_image=my_image->next;
}
DestroyMagickWand(magick_wand);
Is there a good way to optimize this?
I read about the Pixel Cache stuff and thought things would get faster when allocating one PixelCache once and then re-use that one for every image. But i guess using MagickCore functions isn't a good idea. I don't even know what exactly takes so long in the above code. I first wanted to ask here before I begin profiling half the ImageMagick code :)
thanks for any suggestions
regards