I have a GIF image :
It's 27.4KB
My code is :
Code: Select all
int main()
{
ExceptionInfo * exception = AcquireExceptionInfo();
ImageInfo *image_info = CloneImageInfo((ImageInfo *) NULL);
(void) CopyMagickString(image_info->filename, "/root/346889.gif" ,MaxTextExtent);
Image * image = ReadImage(image_info, exception);
Image * coalImage = CoalesceImages(image, exception);
(void) CopyMagickString(coalImage->filename, "/root/1.gif", MaxTextExtent);
WriteImage(image_info ,coalImage);
DestroyImages(image);
DestroyImages(coalImage);
DestroyImageInfo(image_info);
DestroyExceptionInfo(exception);
return 0;
}
the output GIF image is :
It's 271KB
In my code, I used CoalesceImages to get the same size images of te GIF image, and my question is :
How to write a GIF image with the same file size after use CoalesceImages ?
thanks.