text to image optimization

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
miguelx6
Posts: 2
Joined: 2010-02-25T03:05:06-07:00
Authentication code: 8675308

text to image optimization

Post by miguelx6 »

Hello

I am using ImageMagick to create images from text. I am having a problem with the time execution of the source code. My applications demands to create the image in less than 100ms, but it takes 600ms. Any sugestion?

_width=576
_heigh=160
_ncolors=16
COLOR_DEPTH=8


This is the sourcecode i am using

_image = new Image(Geometry(_width,_height),_bg_color);
_image->depth(COLOR_DEPTH);
_image->magick("PNG");
_image->textEncoding("UTF-8");
_image->type(PaletteMatteType); //IT TAKES ALMOST 300 MS
_image->quantizeColors(_ncolors);
_image->boxColor(_tb_color);
_image->fillColor(_fg_color);
_image->strokeColor(_stroke_color);
_image->font(_font);
_image->fontPointsize(_pointsize);
_image->annotate(autoBreakText(text, _font, _pointsize),_gravity_t);
_image->quantize(); //IT TAKES ALMOST 300 MS
Post Reply