text to image optimization
Posted: 2010-02-25T03:14:32-07:00
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
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