r/GIFCreators • • Apr 23 '13

Compression optimization for Cinemagraph GIFs

13 Upvotes

Just a post with a few words about compression efficiency, especially for Cinemagraphs.

I recently found this GIF in /r/Cinemagraphs:

http://i.minus.com/i4EYOAMFB6urf.gif

Since it's unusual for a Cinemagraph to be too big for imgur.com, I tried to find out why a GIF with tiny movements has almost 10 MB.

I first thought the GIF was created without any delta encoding at all, but that turns out to be wrong. The majority of the image seems to be masked with a static background, which already lowers the file size a lot. Then I found out that the noise that remains in the masked area is a huge data filler.

Here's an optimized version with just 960 KB that fits on imgur.com:

http://i.imgur.com/CnDiohe.gif

That's a tenth of the original GIF's size!

The visual difference is very small, but if you enable the frame disposal with Gifsicle (gifsicle <file>.gif --disposal=bg "#0--1" -o <file2>.gif), the difference becomes obvious:

Original GIF:

http://i.minus.com/iwrcOToQFO2j.gif

Optimized GIF:

http://i.imgur.com/5PoGqLv.gif

With the frame disposal edit, every frame in the GIF is cleared before displaying the next one instead of keeping all pixels of all previous frames until the loop restarts.

As you can see, the noise takes up a majority of the pixel data instead of just the moving elements. In this case, ImageMagick with a color fuzzing range of 10% (-fuzz 10%) can be used to optimize the GIF. Such high fuzz values usually don't work well with subtle color changes, but the contrast of the cars is high enough to get rid of most of the noise pixels without producing weird artifacts.

The better way would be to denoise the source video before encoding the GIF with lower fuzzing values. There are various ways to remove the noise from a video, depending on the video editing software you use.


r/GIFCreators • • Apr 10 '13

Collection of GIF making tutorials

12 Upvotes

Unless you are using a site or an application that converts straight from video to GIF, the process of creating a GIF involves the extraction of video frames from a video source, and then putting those frames together to produce the GIF. In between those two steps, you can optionally edit the video or the frames to do things such as adding effects, adding text captions, correcting color and contrast, adjusting frame alignments in an attempt to make the GIF loop perfectly, etc.

Keep this in mind as you browse the following list of tutorials. Feel free to mix and match to suit your own situation. eg you could always use Avidemux to capture and then use Photoshop, or, you could use VirtualDub or whatever.

  1. It's easiest if all you want is to capture straight from youtube, vimeo, liveleak, etc: Gfycat can make GIFs, as well as making the more efficient HTML5 "Gfy" for you.

  2. Another alternative comparable to the above is http://ezgif.com.

  3. Special case: If the video is already a reddit submission, make a coded comment in the thread and /u/JiffyBot will make it for you. Here is an example on how to ask. You can only ask to make GIFs of 15 seconds or less of the footage -- assuming the particular subreddit hasn't banned it. Discussion: http://redd.it/1fvm5m.

  4. If your video is already an .AVI file, you could open it directly in VirtualDub. Once it's in VirtualDub, you can trim, apply filters, etc.

    Now you can generate a GIF using File > Export > Animated GIF. Size may not be ideal, but hey, you made a GIF.

  5. This method is one of the hardest, but it gives you the best control and freedom. You can use virtually any major video formats (containers as well as codec). You can process the source video or the captured frames to add effects, pan, stablize, crop, add text, etc. You can adjust individual frame rate within the GIF. And more! KeepVid/CamStudio + FFmpeg + VirtualDub + ImageMagick + Gifsicle + AviSynth.

  6. Avidemux + GIMP

  7. Import existing video frame files, or import videos directly into Photoshop (requires Photoshop Extended CS5, or CS6 or later).

    Now edit the frames if necessary.

    Next, Window > Animation in CS5, or Window > Timeline in CS6; Save As Web, and choose GIF

    Other than FFMpeg mentioned above, two other programs that let you capture the video frames are KMPlayer and Final Cut Pro (Mac only). Hence the following two tutorials.

  8. KMPlayer + Photoshop

  9. Final Cut Pro + Photoshop, a short tutorial written by /u/harris5.

  10. Freemake Video Converter + Video to GIF Converter Free + Microsoft GIF Animator + Online Image Editor, a short tutorial written by seeegma.

  11. A very thorough tutorial on how to make quality GIF:

    http://morgrana.tumblr.com/post/61997425527/super-huge-massive-giffing-tutorial

  12. How to make a gfycat/gif longer than 15 seconds using online-convert.com and gfycat.com

  13. Special case: Convert what's on screen directly to GIF using the GifCam app for Windows, created by giffan. Supports Windows 8, 7, Vista, and XP. GifCam maybe malware. See here and here.

Please know that with GIMP/Photoshop, you do not always have the controls to reach the particular file size/quality balance that you may have in mind. If you want finer control in that area, you will have to use ImageMagick and Gifsicle.


r/GIFCreators • • Jan 27 '13

Types of loops and how to create some of them with AviSynth

10 Upvotes

This is an overview of various types of loops for animated GIFs and how to create some of them with AviSynth. The names of the loops are my idea and possibly have different names in professional video editing. It's assumed that you already know the AviSynth basics, how to load videos via .avs scripts and how to convert them to GIF (if not, don't worry. I'll write a guide for that, too!).

As a generic example, I'm using the Adobe Universal Leader, a digital version of the classic SMPTE Universal Leader seen in many old films:

http://i.imgur.com/7dFlz0f.gif

It also has two frame counters for reference: the yellow counter for the GIF frame and black for the source video frame.

Simple Loop

The video is simply looped between two points. It's the easiest and by far the most common method. However, for seamless loops it's actually pretty difficult. Even tiny differences between the start and end frame can become a nuisance, destroying the illusion of a perfect loop.

Leader example

In AviSynth, a simple Trim should do the job.

Examples (seamless):

Cinemagraph examples:

Stop-And-Go Loop

Small modification of a simple loop where the video starts motionless, then comes to life after a short delay. Mostly used in Cinemagraphs.

Leader example

In AviSynth, this can be done by repeating the first frame multiple times:

clip.Loop(60, 0, 0) # repeats the first frame 60 times

The repeated frames will be automatically converted to GIF delays when converted via ImageMagick with the "-layers OptimizePlus" parameter.

Cinemagraph examples:

Reverse Loop

The video is repeated in reverse at the end to form a more or less seamless loop. The first and last frame of the reversed part is usually removed to avoid duplicate frames. In theory, this can be used to turn every clip into a loop.

When used on Cinemagraphs, it needs to be adjusted carefully to avoid the ping-pong effect, which is frowned upon.

Leader example

This function creates the effect in AviSynth:

# ReverseLoop
#   Repeats a clip in reverse with the first and last frame of the reversed part being removed.
#
# PARAMETERS:
#   freezeFrames  - Amount of frames to repeat the middle part of the loop. (default: 0)
#   fast          - When true, play the reversed part with double speed by skipping odd frames (default: false)
#
Function ReverseLoop(Clip clip, int "freezeFrames", bool "fast")
{
    freezeFrames = Default(freezeFrames, 0)
    fast = Default(fast, false)
    
    forward = clip.Loop(freezeFrames, clip.FrameCount, clip.FrameCount)
    backward = clip.Reverse().Trim(0, clip.FrameCount - 2)
    backward = fast ? backward.SelectEven().AssumeFPS(clip.Framerate) : backward
    return forward + backward
}

Cinemagraph examples:

Stop-And-Go Reverse Loop

Variant of the reverse loop where a short delay is inserted at the start/end and optionally in the middle before the reversed part starts. Also mostly used in Cinemagraphs.

Leader example

In AviSynth, this can be done using the custom ReverseLoop function and setting a middle frame loop:

clip.ReverseLoop(50) # repeats the middle frame 60 times

Cinemagraph examples:

Quick Reverse Loop

Another variant of the reverse loop for Cinemagraphs where the reversed part is played at a faster speed to reduce the ping-pong effect.

Leader example

In AviSynth, this can be done using the custom ReverseLoop function with the "fast" parameter set to true:

clip.ReverseLoop(fast = true)

Cinemagraph examples:

Fade Loop

A more advanced method where the video overlaps and dissolves into itself to form a seamless loop. Depending on the video source, the overlapping part can be just a few frames up to half of the video long. Works great on diffuse movements, such as falling rain, fire, flowing water, moving smoke or falling sand. Normal movements usually produce ghosting and are therefore less suitable unless they're very regular. Too few overlapping frames may also produce temporary blur and too many may wipe out details.

Leader examples:

For AviSynth, I created the FadeLoop function:

# FadeLoop
#   Blends a clip over itself to form a seamless loop.
#
# PARAMETERS:
#   overlap  - Amount of frames used for overlapping. (default: FrameCount / 2)
#
Function FadeLoop(Clip clip, int "overlap")
{
    overlap = Default(overlap, Int(clip.FrameCount / 2.0))
    framesFinal = clip.FrameCount - overlap
    
    # blend the clip over itself three times
    Dissolve(clip, clip, clip, overlap)
    
    # extract the loopable middle part
    Trim(framesFinal, framesFinal * 2 - 1)
    
    return last
}

It can be used just like the previous function:

clip.FadeLoop() # overlaps half of the video

or

clip.FadeLoop(10) # overlaps 10 frames of the video

Examples:

Cinemagraph examples:

Ouroboros Loop

Rarely used method where the video temporally intersects itself multiple times, pretty much like a snake eating its own tail, hence the name. Requires tricky background masking and can be combined with other loop types. It also allows pretty long animations with very few frames.

Cinemagraph examples:

Examples:

Infinite Zoom Loop

Probably one the most difficult and time consuming methods where the video is repeated, scaled, blended and moved multiple times in a way so it gives the illusion of a never ending zoom. Works best on fractal structures.

Examples:


r/GIFCreators • • Jan 17 '13

Making GIFs with free software tools: FFmpeg, VirtualDub, ImageMagick, and friends.

9 Upvotes

You can always use one of the video-to-gifs sites out there, but if you want the benefits of finer control (cropping, trimming, speed, rotation, stabilization, color etc), the following is one way GIFs can be made.

  1. Download your source video, using something like KeepVid or savefrom.net, choosing at least 720p if and when available. Or, use CamStudio to capture video playing on screen, which generates avi files directly and you can skip the next step. CamStudio doesn't always work and the video captured may have quality issues, but when it works for you, it saves you the time of downloading of the video.

  2. If you need to edit the video, first convert your video to avi using FFmpeg, because VirtualDub (in the next step) cannot understand mp4, flv, etc. For me, VirtualDub can decode the original codec used by youtube, so we just need to change the container from mp4 to avi without the need to re-encode -- hence, "-vcodec copy". This is also a good point to trim your video at least roughly. In this case, I want the part starting at 15 seconds for 5 seconds ("-ss 15 -t 5"), and throw away the audio stream ("-an"). "-y" means "just overwrite the output file if it exists, don't ask".
    The command: ffmpeg.exe -i cats.mp4 -ss 15 -t 5 -an -vcodec copy -y EDIT_ME.avi

  3. (Optional) Edit the avi using VirtualDub. It's true that simply crop, resize and trim will make the file size smaller, but in general, don't neglect to edit, because this part is the most fun, you get to play director! You get to crop the video to just the little rectangle that's interesting. You get to trim out the annoying, irrelevant, distracting frames. You get to arrange the clips in different orders. You get to change the mood from a yellowish shaky wandering pointless 80s home video to quality coolness. Hey you even get to tell a different story if you're clever enough. Repeat this step until the video brings a smile to your face.
    BTW I use "Uncompressed" for video compression (the default) to preserve video quality as I go through the edit-and-save cycles. As the videos are typically short and small, this should be fine.
    If you are working on something advanced and need a lossless compression codec, under Video > Compression... (Ctrl+P), choose ffdshow Video Codec, click Configure, and in the Encoder tab, choose HuffYUV. There is no need to download HuffYUV.

Bonus: From /r/ImageStabilization, here is how to stabilize a video using Hugin Panorama Creator: http://redd.it/1xri2q

  1. Rip pictures every x seconds from the edited video, again using FFmpeg; these pictures will be the individual frames of the GIF -- note how x, the frame rate of 0.06 seconds in this example, is passed to ffmpeg: "-r 100/6". "-q:v 0" means preserve the video quality. "-t 100000" is just my way of saying rip the whole video (100000 seconds is 28 hours, yeah right -- so your video better be trimmed in the previous steps. I use mjpeg as the encoding codec for pictures, seems to work: "-vcodec mjpeg". "%03d.png" means save the files as 001.png, 002.png, etc.
    The command: ffmpeg.exe -i GIF_ME -q:v 0 -ss 0 -t 100000 -r 100/6 -vcodec mjpeg %03d.png

  2. (Optionally) Examine the pictures one at a time, in case you want to throw away a few of them, edit them in photoshop, make the repeat sequence seamless, or whatever. The more frames you remove, the smaller the resulting GIF in terms of file size.

  3. Combine the pictures to make an animated GIF using ImageMagick -- note how the frame rate of 0.06 seconds in this example is passed to ImageMagick: "-delay 6". Experiment with the percentage after "-fuzz", generating one GIF for each fuzz percentage that you came up with, and see what size/quality you'll get for this video. The higher the fuzz value, the smaller the file size, at the cost of a fuzzier GIF. Save these candidates.
    The command: convert +repage -fuzz 3.0% -loop 0 -delay 6 *.png -layers OptimizePlus -layers OptimizeTransparency Target.gif

  4. (Optional) To make the final GIF smaller, make more candidates by conducting one last optimization using Gifsicle. What's after "--colors" is the number of distinct colors to limit to in the output GIF. Remember the candidates in the previous step? Experiment with this number, generating one GIF for each number that you try that's smaller than or equal to 256 for each of the candidates in the step above , and see what size/quality you'll get. Save these candidates. Bear in mind that some or all of these candidates produced by Gifsicle may not be usable.
    The command: gifsicle -O3 --colors 128 Target.gif 1>Done.gif

  5. Sort the candidates in the two steps above by size. Start from the smallest one, and see if its quality acceptable. Keep going down the list until you see one that's good enough, and upload that one. Why? Because nobody likes to wait for a GIF to load.

  6. When your GIF is ready, upload it to gfycat. It's better than imgur in that it doesn't limit your GIF size to 4M, and better than min.us because your GIF will be more responsive to load.

The actual steps are a little more involved than the above, although anything possible with the command line are all automated in my environment. I extracted and simplified those steps from my environment to an understandable form for your information, you are free to innovate here. Depending on the video, typically more filters are applied in step 3 above; I almost always use resize, Deshaker, rotate2, levels, White Balance, Color Mill, and sometimes De-Ghosting, fader, one of the deinterlace filters, and one of the sharpen filters. In my environment, GIF candidates from steps 6 and 7 above are produced by automated scripts.

I just started making GIFs less than a month ago -- see my history, you can see the progress in quality. There are a lot of things I don't know about these things yet. Most of the above were from google searches and I don't claim to have come up with any of it. If you google the commands listed here, you should be able to find out more from the web.

Please share if you have more information.

Free tools (the best that I could recall):

  1. KeepVid (requires Java)

  2. savefrom.net (does not require Java)

  3. CamStudio

  4. FFmpeg

  5. VirtualDub

  6. Deshaker

  7. ImageMagick

  8. Gifsicle

More free tools to look into if you ever need them:

  1. ffdshow codecs (codecs you may need to open certain videos)

  2. Avisynth + another quick intro (perform processing not possible with VirtualDub)

  3. MediaInfo (obtain technical details of your video, such as codec used)

Let me know if I missed anything..


r/GIFCreators • • Jan 25 '17

My workflow for erotic gifs [SFW]

8 Upvotes

I've received a couple questions about how I make my gifs and video clip previews. I choose to keep my collection in one place, imgur, so my workflow centers around that. You can find examples in my reddit history and even find the URL of my (username).imgur.com gallery if you are so inclined. Both are very NSFW.

Tools

  • Photoshop

  • Premiere

  • Gimp

Source

All my content is filmed in 1080p 60FPS, so it is both high quality, has a lot of frames, and cropping with slow motion is an option. I output video to .h264 format on a mp4 container.

Workflow for a teaser gif(v) on imgur

  1. Create a new sequence separate2 from the main film sequence in Premiere. I either copy and paste the main film sequence, or close all sequence tabs and drag a bit of source footage to the timeline. Be sure to rename it "gif1" or something to identify it.

  2. Crop the sequence. The best way I know to do this now is to right click the gif sequence in the "Project" tab and choose "Sequence Settings", then set the "Editing Mode" to "Custom", and finally type in the pixels that you want to crop the sequence too. After applying and allowing previews to regenerate, scrub the play head around and ensure it is close to the correct size. Use the "Motion" controls for "Position" under the "Effect Controls" tab to move the clip so it is centered properly.

  3. Trim your clip to the correct length, 15 seconds for imgur if that is your target. Test looping the clip by duplicating it, click your clip in the timeline, ctrl+c, press shift+end to jump to the end, ctrl+v. Delete duplicate clips when done inspecting.

  4. Export you clip, mine are usually 6-10mbps single pass h264. FPS does not matter but reducing it to 25 will save you time later.

  5. Repeat step 1 for any other clips you would like to make.

  6. Imgur does not allow direct upload. Use the upload button on eroshare.com to upload several clips at once and let them process.

  7. After they process, in Firefox click a clip to play it. Right click a clip and choose view video. Right click again and choose copy video URL.

  8. Sign into imgur.com, and then access http://imgur.com/vidgif. Paste in the URL for your video. If it fails to load, go back to imgur.com/vidgif and hold shift, then click reload button. Do the same for the eroshare.com page and copy the URL again. Eventually, it always works for me.

  9. On imgur.com/vidgif, click in the timeline to create a start point and then remember to extend the time to the maximum or time you prefer. Don't worry if it does not look like it stretches far enough.

  10. Click create gif.

Workflow for a teaser gif(v) on tumblr

  1. Start with an exported mp4 from the process before, only ensure it is 25fps or below.

  2. In Photoshop, choose "File..Import...Video Frames to Layers", make sure frame animation is checked.

  3. Ensure you don't have an excessive amount of layers, between 80-190 is fine.

  4. Resize your image to something manageable, such as 500px max height or width.

  5. Choose "File...Save for web" and choose type of gif and type of gif, with transparency without dither.

  6. At the bottom left is the file size, which needs to be be below 2.0MB. First change the "Percent" at the bottom right to get you in the ballpark, and then change the "Selective/Adaptive" options at the top to give it the best color/size trade off. Each gif will be slightly different and requires fussing with.

  7. Remember that less frames means your dimensions in pixels can be higher for a clearer image.

Sometimes I'll use GIMP to fine tune GIFs as it is easier to change timing and individual frames and get predictable results.


r/GIFCreators • • Mar 14 '13

Every single time i optimize with gimp. NSFW

8 Upvotes

r/GIFCreators • • Nov 10 '16

My new tool to convert online videos to GIFs of any length

6 Upvotes

I made a tool that converts a YouTube (or Vimeo, etc.) video into a GIF file or a partial video, or to download its sound clip. The tool does not have a time range limit as most online gif converters do(some have limit of 15 sec), so you can choose whatever the length of GIF file.

You can visit http://mediaopener.com to download the tool, which supports Windows and MacOS. Can you please try it to see whether it helps?

This tool is newly developed and is in beta. I am actively working on it to improve it. The UI is still rough and there shall be bugs. Please let me know if you see any problems.

Robo


r/GIFCreators • • Dec 30 '14

Make a gif from tube video

6 Upvotes

iloopit.net

how it works:

  • submit tube video url (copy from browser's address bar)

  • pick the start and the end of favorite episode

  • view "Gif demo" and refine episode carefully checking frames

  • enter name and tags

and here you are. your can download a gif, share to reddit , twitter (embeds to twitt), tumblr (embeds to post), embed to your blog or website

Supported tubes: vimeo, pornhub, xhamster, madthumbs (so tool for nsfw gif creators rather at this moment) youtube.com is coming soon


r/GIFCreators • • Jul 22 '15

Is this the free GIF making software you've been looking for? Try new LOOPSCICLE for all your GIF and WEBM making needs!

5 Upvotes

Our coder has been hard at work and is ready to show off his latest creation:

LOOPSCICLE

A desktop application for WINDOWS only, 4 megabytes of disk space made especially for the editing, creating and sharing of GIF and WEBM animations.

Take apart and split your favorite internet GIFS, re-order, re-organize and re-imagine them with the support of a smart user interface. Combine tracks, use text, effects and advanced render techniques to create what you want.

*Tutorials:

Making you first GIF

Recording the screen

Greenscreen your GIF


r/GIFCreators • • Dec 13 '18

Gif making and gif blogging in one - Tumblr alternative for nsfw gifs

4 Upvotes

Hey,

i'm Aiden from iloopit.net (online adult gif maker).

We decided to occupy the niche of Tumblr in part of web blogging platform for nsfw gifs.

After project's upgraded users will be able to 1) publish gifs they created as a blog site 2) collect gifs 3) get appreciation from community: likes, rating 4) create gifsets - playlists of gifs created from common video.

I'd like to ask you for feedback about this initiative

Here is our detailed plan: r/iLOOPit_official - tumblr alternative for nsfw gif blogging/


r/GIFCreators • • Feb 15 '17

Best GIF creator?

4 Upvotes

I just wanted to know if anybody knows any good gif creator in terms of frames, quality and size.


r/GIFCreators • • Nov 12 '21

Looking for an android app that supports url from adult aites e.g. Xvideos, PH

3 Upvotes

The titles sums it up well. Looking for an app thats stable. I just want to cut some soecific moments from the url and download the cut part as GIF or mp4.


r/GIFCreators • • Jun 22 '20

NEW AWESOME GIF CREATOR / PLATFORM

3 Upvotes

Hey there everyone, I would like to introduce you to an application I've been secretly working on this whole pandemic called GIFSOM.

GIFSOM is a new hybrid application meaning it'll work on your computer or mobile devices, it's main purpose is for creating high quality GIFs from all kinds of resources and to give you the fastest search as well as give you kind of a social aspect. Created GIFs can be shared across many platforms and downloaded in .GIF and .WEBP formats. The GIFs you create can be up to 30 seconds long and you can create gifs from the following video urls:

  • 9gag

  • AdultSwim

  • Break

  • Coub

  • Crunchyroll

  • Dropbox

  • Facebook Video

  • Flickr

  • Gfycat

  • GoogleDrive

  • Imgur

  • Instagram

  • MTV

  • Patreon

  • Photobucket

  • Reddit

  • Slideshare

  • Steam

  • TikTok

  • TMZ

  • Tumblr

  • Twitch Clips

  • Twitter

  • Vimeo

  • VK

  • Vodlocker

  • Weibo

  • WorldStarHipHop

  • Youtube

  • Yahoo Videos

  • Yandex Video

So what are you waiting for? Get your GIF on!!

Note: This is an alpha, a short alpha, I'm very excited to see where this goes, I'll be creating a blog shortly for development and other things as they happen.

This is a full fledged application, a little disclaimer you need to sign-up to use the creator, non of your information is public besides your user_tag ie"@user"

Gifsom


r/GIFCreators • • Sep 17 '17

GIF image making tips and tricks.

3 Upvotes

How to make GIF images for Reddit?


r/GIFCreators • • Sep 29 '16

How to remove "grain" texture on my gifs?

3 Upvotes

So, I converted a video to animated gif using Premiere Pro and it looks like this.

Notice how it has white dots appearing everywhere when it shouldn't look like that. It's mostly noticeable with the shoes. Here's a screenshot from the preview.

I've been playing around with this for hours (like the aspect ratios for both source and export) but I can't figure out what's wrong. I'm currently using the default settings because everything else is worse.


r/GIFCreators • • Mar 29 '15

Submitting GIFs to tumblr blogs

3 Upvotes

I tried dropping this question over at /r/tumblrhelp but didn't get any response, was hoping someone here might be able to help me...

What's the trick? The best I can come up with is to insert the gif address into a Text post as it doesn't appear as though the Photo option likes gifs. If you know the answer I would also like to know how to make sure that my gif is properly attributed to my blog.

So yeah, I want to submit my gifs to other blogs, want them to be nice and big and also want them to be properly attributed to my blog. Any help greatly appreciated!! - Thanks in advance.


r/GIFCreators • • Apr 30 '14

Help with adding a jpg to a gif at a specific time?

3 Upvotes

I want to edit this .gif to have the flexing muscleman replaced by a few .jpgs but I'm new to gifs and don't know how, please help!


r/GIFCreators • • Jul 08 '13

QGifer is a free video based animated GIF creator

3 Upvotes

TL;DR: You can get it for Linux, BSD, and Windows here

This was this week's desktop pick on the Linux Action Show but is also available for Windows and entirely free!

It sports a clear GUI and several features such as: easy selection of both timeframe and area of a video to be converted, inserting text and other images, several effects, and some GIF optimization options.

I haven't had the opportunity to play with it myself, but there's a demonstration video here which looks pretty promising.

Try it out, and let us know what you think!


r/GIFCreators • • Jan 26 '13

How to create movement masks with AviSynth

3 Upvotes

Here's a short guide on how to apply movement masks on videos with AviSynth, which are important tools to create Cinemagraphs. It's assumed that you already know the AviSynth basics, how to load videos via .avs scripts and how to convert them to GIF (if not, don't worry. I'll write a guide for that, too!).

Masking in general can be done in AviSynth the same way like in Photoshop (or most other image editors) using black-and-white masks. In case of a movement mask, black means fully static, white means fully moving and grayscale means semi-transparent blending with the static background for smooth transitions. It also allows you to use animated masks, which can be much more flexible compared to Photoshop's static layer masks.

The two important functions for that are Mask and Layer. For static masks, you basically need to load an image using ImageSource, then use it to mask a clip, then freeze a specific frame so it can be used as a background, then finally layer the masked video over the static background. Since this requires a few steps in AviSynth, I wrote two functions for it:

# IsolateMask
#   Isolates any motion in a clip with the help of a mask clip.
#
# PARAMETERS:
#   mask        - The clip used as mask. Should be B/W.
#   frame       - The frame number used as static background (default: 0)
#   startFrame  - Sets the first frame to apply the mask on (default: 0)
#   endFrame    - Sets the last frame to apply the mask on (default: FrameCount)
#   invert      - If set to true, the mask is applied inverted (default: false)
#   highlight   - If set to true, highlight the masked area for easy previewing (default: false)
#
Function IsolateMask(Clip clip, Clip mask, int "frame", int "startFrame", int "endFrame", bool "invert", bool "highlight")
{
    frame = Default(frame, 0)
    startFrame = Default(startFrame, 0)
    endFrame = Default(endFrame, clip.FrameCount)
    invert = Default(invert, false)
    highlight = Default(highlight, false)
    
    overlay = invert ? clip.FreezeFrame(startFrame, endFrame, frame) : clip
    background = invert ? clip : clip.FreezeFrame(startFrame, endFrame, frame)
    
    overlay = highlight ? overlay.ApplyRange(startFrame, endFrame, "Levels", 0, 2, 255, 0, 255) : overlay
    
    return Layer(background, overlay.Mask(mask))
}

# IsolateMaskImage
#   Isolates any motion in a clip with the help of a mask image.
#
# PARAMETERS:
#   mask        - Path to an image file used as mask. Should be B/W.
#   frame       - The frame number used as static background (default: 0)
#   startFrame  - Sets the first frame to apply the mask on (default: 0)
#   endFrame    - Sets the last frame to apply the mask on (default: FrameCount)
#   invert      - If set to true, the mask is applied inverted (default: false)
#   highlight   - If set to true, highlight the masked area for easy previewing (default: false)
#
Function IsolateMaskImage(Clip clip, string maskPath, int "frame", int "startFrame", int "endFrame", bool "invert", bool "highlight")
{
    IsolateMask(clip, ImageSource(maskPath, 0, 0, pixel_type = "RGB32"), frame, startFrame, endFrame, invert, highlight)
}

It is recommended to save these functions in an .avsi file inside "plugins" of the AviSynth installation folder to avoid including it in every script manually.

The first function requires a clip as a parameter. It can be a static mask from an image file or a dynamic mask from a B/W video:

AVISource("video.avi")
ConvertToRGB32()
mask = ImageSource("mask.png", 0, 0, pixel_type = "RGB32")
IsolateMask(mask)

The second one is for convenience that saves the ImageSource step for static masks. It can be used this way:

AVISource("video.avi")
ConvertToRGB32()
IsolateMaskImage("mask.png")

Here's a real world example from EVE:

The complete script for the final result (uses some more of my functions that I'll document in future guides):

FFVideoSource("eve.mp4")
ConvertToRGB32()
Trim(3, 20)
IsolateMaskImage("mask_weapon.png")
FadeLoop(6)
Shift(4)
Loop(60, 0, 0)
ResizeByWidth(1280)
#Loop(100)

r/GIFCreators • • Jan 21 '13

How to use VirtualDub to preview the looping in your animated GIF, without first making the GIF

3 Upvotes

Make an AVIsynth file of your video with the Loop command, and then open that AVIsynth file with VirtualDub and play it.

 AviSource("YourVideo.avi").Trim(13,115).Loop

The Trim in the script limits the loop to a certain set of frames. Previewing the loop in VirtualDub this way is a much more efficient way to create GIFs, especially if you're trying to create perfect loops.

Or, if you already have the frame files, look into Avisynth's ImageSource.

Free tools and references:

  1. Post about ImageMagick, VirtualDub and friends

  2. Post about Avisynth

  3. Avisynth's ImageSource

  4. barracuda415's Avisynth function is a different way to fake a perfect loop by merging the frames


r/GIFCreators • • Jan 18 '13

How to add captions to your GIF

3 Upvotes

See this post on how to generate frames from a video and then use those frames to make an animated GIF: http://redd.it/16s803.

One way to add captions to an animated GIF is to edit the individual pictures and add the caption to those pictures with something like Photoshop, but it can get tedious. What I do is to use AVISynth and its Subtitle command. Here is an example script (description on how to use the script file will follow):

AviSource("C:\temp\YourVideo.avi", false)
Subtitle("WAT", text_color=$11ffffff, font_width=18, size=50, align=2, font="Verdana", first_frame=11, last_frame=50)
Subtitle("WHY", text_color=$11ffffff, font_width=18, size=50, align=2, font="Verdana", first_frame=55, last_frame=80)
  1. Extract and prepare your video in VirtualDub as explained in the post mentioned at the top of this page. Make a note of the frame numbers where you want the caption to appear. Write down your list of captions, the first frame, and the last frame for each of the captions.

  2. Create your script such as the one above as a text file, and save it with the avs extension (eg SomeFile.avs). Obviously, AviSource in the script is how you tell AviSynth the location of your video file.

  3. Drag this AVS file into VirtualDub.

  4. in VirtualDub, File > Save as AVI (or just F7) and now you have just saved an AVI video with captions

  5. Proceed to make GIF out of this AVI file

Tools and references:

  1. AviSynth

  2. AviSynth documentation on the subtitle command

There are cases where the plain subtitle command is not sufficient:

  1. If the captions is in non-English languages

  2. If you want to incorporate subtitles in the traditional sense, as in utilizing existing movie/TV subtitle files out there

  3. If you want better control over the styling of the text (font face, font size, orientation)

  4. If you want to animate the text (scrolling, fading etc)

For these cases, look into Avisynth's Animate command. Also, try the TextSub command in the VSFilter filter, together with subtitles downloaded from the web or generated with something like Aegisub or Subtitle Workshop. Language, as well as font and animation attributes, can be specified in SSA ("SubStation Alpha") and ASS ("Advanced SubStation Alpha") formats.

Tools and references:

  1. Documentation on Animate

  2. Documentation on TextSub, which is part of the VSFilter filter

  3. Aegisub, a subtitle editor

  4. Subtitle Workshop, a subtitle editor


r/GIFCreators • • Feb 22 '26

why isnt giphy gif uploading

2 Upvotes

its stuck on the uploading screen always


r/GIFCreators • • Dec 05 '24

Please help.

2 Upvotes

Google has not been of any help. Hi everyone. I was wondering if any of ya'll can help me with this: When we look up gifs on any social media platform or online, results come up. My question is: How and where should I upload my gifs so they come up when people search for something?


r/GIFCreators • • Oct 12 '22

When You Upload Videos to Trim Them on RedGIF, what happens to the Original Video? Does It Get Deleted After the Encoding Trims It to the Scene You Selected To Be Used As GIF?

2 Upvotes

Asking because I'ma bit worried about copyrights. I uploaded an old Universal ANimated movie and trimmed it down to one scene for the whole GIF.

What happened to the movie I uploaded? Is it stored in my account's database after the upload and the encoded that trimmed it down to the scene to make a GIF? Or was the whole movie automatically deleted after the encoding cut the entire video to the scene I selected fo rthe GIF and only that GIF remains upon my account's database?

To be on the safe side should I save the GIF under a different name then deleted it from my Redgif account and reuploded the GIF once again this time from the new saved file that was created as a new vid when the whole movie was uploaded on RedGIF?


r/GIFCreators • • May 01 '22

Can I share collections of gifs with a specific person?

2 Upvotes

I had this idea to create a custom gif library/collection of inside jokes for my friend as a gift. I am planning on having to create all of the gifs myself (although finding some pre-made would be a boon). All I finding is the ability to add gifs to crowd-sourced keyboards or saving your favorite gifs to your own personal keyboard. I want to create a collection that someone else can see (sort of like following a Spotify playlist--shareable in its entirety). Is that possible? What tools would you recommend?