Page 1 of 1

use global color table instead of local color table

Posted: 2012-07-18T05:22:08-07:00
by echo1986
Hi, all
Now,I am using Magickcore API for my project,In order to reduce Gif file size,I need to use global color table instead of local color table,but I can't find any C api that can fix my problem.
thanks for any help. :D

Re: use global color table instead of local color table

Posted: 2012-07-18T05:39:33-07:00
by magick
ImageMagick utilizes a global colormap if all images in your sequence have the exact same colormap. You can ensure it does with the RemapImages() method.

Re: use global color table instead of local color table

Posted: 2012-07-18T06:19:16-07:00
by echo1986
magick wrote:ImageMagick utilizes a global colormap if all images in your sequence have the exact same colormap. You can ensure it does with the RemapImages() method.
Thanks for your quick respondse,after using QuantizeImages(),size of my gif has been increased form 141163 bytes to 179110 bytes,in your advice in this topic(viewtopic.php?f=7&t=14172),I attempt to solve this problem with RemapImages() as follows ,object image was set up by BlobToImage() a gif.

Code: Select all

remap_image = GetLastImageInList(image);
         //remap_image = GetImageFromList(image, 2);
         RemapImages(p_QuantizeInfo, image, remap_image);
I just want to set a global colormap,regard the last image in imagel list as remap image,but it dosen't work as anticipation,can't chage file size, what's problem in my code?

Re: use global color table instead of local color table

Posted: 2012-07-18T19:34:28-07:00
by echo1986
I have resolved the Problem, when I use methord QuantizeImages() ,I don't set parameter whether dither or not,After set QuantizeInfo.dither=MagickFalse,It reach original file size.