Turning gameplay footage into a small README GIF with a Video to GIF Converter
A looping clip at the top of a README or a game page tells people what the project is before they read a word. A screenshot can't show a jump arc or a scrolling camera. The catch is that GIF is a heavy format, and a raw capture pushed through a Video to GIF Converter on default settings can come out several megabytes, which every visitor then downloads just to look at your repo. Here are the…
A looping GIF at the top of a README or game page can give people an idea of what the project is before they read any text. Screenshot images can't show things like jump arcs or scrolling cameras. However, GIF files can be quite large, and downloading them can be unnecessary for visitors. Here are some settings I found that could help reduce the file size while maintaining quality.
Using a test clip of an astronaut running in a pixel platformer, I recorded a 8-second clip at 1280×720 resolution, 30 frames per second. The original video was only 195.0 KB, but when converted to GIF, it ballooned to over 650 KB. To reduce this size, I experimented with different settings and found that a 4-second clip at 640×360 resolution, 15 frames per second, and "Fast" quality resulted in a 649.6 KB GIF.
This was still a sizable file, so I further reduced the width to 480 pixels, which brought the file size down to 497.0 KB.
Frame rate and quality also affect the file size. I tested different frame rates and quality settings and found that 15 fps and "Fast" quality were the most effective for reducing file size while maintaining good visual quality for pixel art. Additionally, keeping the color detail at 256 colors instead of the higher 256 to 32 options also helped reduce the file size.
When adding the GIF to the README, make sure to commit it to the repository and reference it with a relative path. If you want it displayed narrower than its real width, use an HTML tag with a specified width that is a clean fraction of the export width. This ensures the pixels stay even and the download size remains small.
In summary, a small looped GIF can effectively showcase a game or project's preview, and by adjusting the settings such as resolution, frame rate, color depth, and quality, it's possible to reduce the file size without sacrificing visual quality.
Rewritten by urgent.news; may contain errors — check the original.
Source: dev.to