Magick++ gif annotation artefacts

97 views Asked by At

I want to make an annotation in a gif image using ImageMagick and specifically Magick++, the code is quite simple, but the output image has artifacts in the text, if the gif does not move, then the artifacts do not appear, here:

Artefacted gif

here is the code itself, very simple:

    int main()
{
    InitializeMagick(nullptr);
    list<Image> *imageList = new list<Image>();
    try {
        readImages(imageList, "source.gif" );
    }
    catch( exception &error_ )
    {
        cout << "Caught exception: " << error_.what() << endl;
        return 1;
    }
        for(Image &i : *imageList) {
            i.fontPointsize(36);
             i.font("helvetica-bold");
            i.fillColor(Color("white"));
            i.fontStyle(MagickCore::ObliqueStyle);
            i.annotate("why are you lagging", SouthGravity);
        }
        writeImages(imageList->begin(), imageList->end(), "/home/deymos/GifnText/n.gif");
    return 0;

I tried to save the list of images as png and this is what I saw when the movement on the gif started:

separate image from gif

is it possible to fix it, or is it a bug?

If this cannot be fixed, maybe there are similar tools with which I can implement text on gifs? or at least a library that can disassemble gifs into images and fold, I can do the rest with qt, tnx.

0

There are 0 answers