Zen GIFr

About

Zen GIFr is a Java program that automatically creates GIFs from videos sized to the internet's liking. Many websites like Imgur or Tumblr have maximum GIF sizes of 2.0 MB. Zen GIFr will automatically create a GIF from video input sized as close as possible to that threshold, handling all the clipping, downscaling, testing, and conversion by itself. You can also tell it to create a GIF of any particular size if the filesize is not important.

Zen GIFr has a few minor filtering options. You may cut the framerate of the input video in half or in third before saving it as a GIF, in order to give it a more "GIF feel," in adddition to saving space. (You may also leave it at the full framerate to capture smooth motion in video.) It also supports overlaying text on the GIF in a white-text-black-border meme style. It uses the font Open Sans Semibold as the font for this. You can change the size of the text overlay or leave it as the default.

Zen GIFr uses mpv as its backend and thus it can read practically any video file.

You don't have to crop the video file time-wise beforehand, because Zen GIFr comes with sliders that allow you to change the start and end timecodes of the GIF.

The current release of Zen GIFr is 0.8.0. All releases will be marked as "pre-releases" until version 1.0.0, when Zen GIFr is production-ready. At this moment it is not. Zen GIFr is still in the middle of development, the UI is a bit clunky, and there will be undiscovered bugs.

Downloading and Running

Zen GIFr is hosted at Github, at https://github.com/thebombzen/Zen-GIFr.

To download the most recent version of the program, go to the releases page. Download the most recent release, which should be at the top. There will be several downloads - download the JAR file, not the zips containing the source code.

Zen GIFr comes as an executable JAR file. You need to have at least Java 8 to run it. If you don't have java installed, download it from https://java.com/ and install it.

  • To execute the JAR file on Windows, doubleclicking it should work as long as you have Java installed. However, some archive programs might try to open it as an archive. If so, open it with the Java Platform (and you should probably set the Java Platform as the default for opening JAR files anyway).
  • To execute the JAR file on a Mac, you need to open it with JAR Launcher. If you try to open it using the default way you might accidentally unzip it and barf a bunch of files all over your desktop. Try not to do that.
  • To execute the JAR file on Linux or other POSIX systems, run java -jar "Zen GIFr.jar".

Issues

If you're having trouble with anything, drop by my discord server at https://discord.gg/gbykrG2. You can get help there. If you find a bug, you can open a ticket on its Github Bug Tracker. If you want to submit a patch, feel free to submit a Pull Request.

Other pull requests and tickets are welcomed as well, not just ones pertaining to bugs or fixing bugs.

Tips and Tricks

  • If you want to cut the framerate in quarter, you can create a GIF with the same width as the original and half the framerate. Then, you can feed that GIF back into Zen GIFr and cut the framerate in half again. Zen GIFr supports practically any video input format, including GIF image.
  • The sliders have six-frame precision. If you have difficulty dragging a slider to get exactly what you need, you can nudge it to the left or the right six frames by using the left or right arrow keys, as long as the slider is in focus.
  • GIFs with very little action, as in, GIFs with a perfectly still background (not a pan/zoom, must be perfectly still) are much better candidates as they will have drastically smaller file sizes, which allows the physical size to be much bigger while remaining under the maximum size. GIFs with lots of action are worse candidates and on average will be significantly smaller.
  • TumblGIFifier will try to warn you if it thinks the GIF will be less than 300 pixels wide before you convert. This is just a guess. It will tend to give false positives for relative still GIFs and false negatives for relatively action-filled GIFs. The only way to tell would be to actually create the GIF. You can also feel free to ignore this warning.
  • TumblGIFifier uses a binary search to get the GIF to be the right size. In order to save time on this search, it uses an initial guess. For GIFs that are fairly still, it will tend to underestimate how big it can be. If the GIF is still enough it's possible that the original video size will be enough. In this case, TumblGIFifier will keep guessing for longer than it should and eventually settle upon a GIF that's extremely close to the max size. If this happens, try creating the GIF at its original width in order to see if you'll actually get something under two megabytes. (This is essentially a bug that I have to fix. You will have to use this workaround until I fix it. Expect a fix sometime in the future coming Soon (TM))

Compilation From Source

First, you need to clone the repository with

$ git clone https://github.com/thebombzen/Zen-GIFr
Then, to compile, run:
$ ant
To clean the build, run:
$ ant clean
Note that you don't have to clean the build if you make a change.

Dependencies and Legal

Zen GIFr is copyright Leo Izen, (thebombzen) 2015-2017, and is licensed under the MIT License. This means in basic terms that you can do practically anything with it except change the license. Included within the program are binary packages of several external libraries:

In addition to the libraries shipped with Zen GIFr, Zen GIFr uses mpv as its backend engine. If mpv is found in your PATH, it will use that. If not, it will download a pre-built platform-dependent binary from here and use that instead. These prebuilt binaries are also available upstream; for Windows at https://mpv.srsfckn.biz, and for macOS at https://laboratory.stolendata.net/~djinn/mpv_osx/. Linux users are expected to install mpv from their package manager or compile it from source.

Zen GIFr will also download the Open Sans Semibold font (from here) and use it for the purpose of overlaying text. Open Sans is copyright Google and Steve Matteson, and licensed under the Apache License 2.0. Open Sans is an optional dependency.

Lastly, if gifsicle is found in your PATH, Zen GIFr will use GIFsicle to further optimize the size of GIFs. If not, Zen GIFr will download a prebuild gifsicle binary (from here), but only for Windows. macOS users and Linux must install it themselves to receive the size optimization provided by gifsicle. This is also an optional dependency.