Need help in creating GIF

Magick.NET is an object-oriented C# interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning Magick.NET
Post Reply
vikrant
Posts: 2
Joined: 2018-02-20T06:12:51-07:00
Authentication code: 1152

Need help in creating GIF

Post by vikrant »

I want to create a gif from images and which will finally look like what has been mentioned in below site (they used CSS and JS to achieve that). http://lab.25sprout.com/fadeImg/
i tried different option like CompositeOperator.Overlay , Colorize(new MagickColor(), new Percentage(1)) etc. But the generated gif was not even close to the mentioned one. Any help here would be appreciated. (I am new to ImageMagick so unaware of many thing).
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Need help in creating GIF

Post by fmw42 »

We do not all understand CSS and Javascript. Please post and example gif animation and we might be able to reproduce it.

Please, always provide your IM version and platform when asking questions, since syntax may differ. Also provide your exact command line and if possible your images.

See the top-most post in this forum "IMPORTANT: Please Read This FIRST Before Posting" at http://www.imagemagick.org/discourse-se ... f=1&t=9620

For novices, see

http://www.imagemagick.org/discourse-se ... f=1&t=9620
http://www.imagemagick.org/script/comma ... essing.php
http://www.imagemagick.org/Usage/reference.html
http://www.imagemagick.org/Usage/
vikrant
Posts: 2
Joined: 2018-02-20T06:12:51-07:00
Authentication code: 1152

Re: Need help in creating GIF

Post by vikrant »

Hi,

I have 6 images:
https://drive.google.com/file/d/1dV8rXz ... sp=sharing
https://drive.google.com/file/d/106onCp ... sp=sharing
https://drive.google.com/file/d/1hOFsu7 ... sp=sharing
https://drive.google.com/file/d/1qSlYP3 ... sp=sharing
https://drive.google.com/file/d/1T7ZkMu ... sp=sharing
https://drive.google.com/file/d/1LKNDcY ... sp=sharing

I am trying to do morph with 3 transition images.

Below is the code:

Code: Select all

        static void Main(string[] args)
        {
            using (MagickImageCollection collection = new MagickImageCollection())
            {
                loopXTimes(collection, 1, "Image1.jpg", 200);
                loopXTimes(collection, 1, "Image2.jpg", 200);
                loopXTimes(collection, 1, "Image3.jpg", 200);
                loopXTimes(collection, 1, "Image4.jpg", 200);
                loopXTimes(collection, 1, "Image5.jpg", 200);
                loopXTimes(collection, 1, "Image6.jpg", 200);

                collection.Morph(3);

                collection.Write("samplemorph2.gif");
                
                
            }
}
static void loopXTimes(MagickImageCollection collection, int times, string image, int delay)
        {
            for (int i = 0; i < times; i++)
            {
                IMagickImage imagick = new MagickImage(image);
                collection.Add(imagick);
                imagick.AnimationDelay = delay;
            }
        }

In the generated samplemorph2.gif gif, the transition is snapping to complete 2 sec. where as I want transition to happen in animation delay 10 ticks, i.e., each image is displayed to 190 animation delay then transition then next image and so on.
If you know how to achieve this in Magick.net libraby, that would be helpful.
Post Reply