Code: Select all
QuantizeInfo *q_info = AcquireQuantizeInfo( image_info );
unsigned long colors = q_info->number_colors;
q_info->dither = MagickFalse;
//colors
colors = colors / 2;
if (colors < 3)
{
colors = 2;
}
q_info->number_colors = colors;
QuantizeImage(q_info, thumbnails);
//for debug
//printf("Adapted colors to %lu\n",colors);
DestroyQuantizeInfo(q_info);
MemTotal: 4050700 kB
My IM version is 6.4.0 and my OS is Linux ubuntu 2.6.24-23-server
Any advice is welcomed,thanks!