OOZOU
Get in Touch
Back to Blog

LOL Errors

Learn how to take a snapshot and animate it as GIF, each time an app error occurs.

December 4, 2014
3 min read
LOL Errors

Inspired by lolcommits which takes a snapshot everytime you git commit code. For fun, we decided to make something similar by taking animated snapshots each time an app error occurs and overlaying the error message on the snapshot. Right now it only supports OS X.

Example

When we get an error.

We also get a poor, struggling developer tearing his/her hair out :-)

Installation

You’ll need ImageMagick and FFmpeg installed. If you use Homebrew, then it is as simple as:

brew install imagemagick
brew install ffmpeg
lang-bash

We can now install the gem by including it in the Gemfile in your app.

gem 'lolerrors', group: :development
lang-ruby

Thats it! You are ready to take some funny snapshots of you fighting with your app. Resulting animations will be output in ~/lolerrors

You can check the code out here https://github.com/oozou/lolerrors.

GIF optimization issue and coalesced animation

We tried to convert the captured video MOV file to a GIF using FFmpeg and optimize it using ImageMagick. The file after optimization was still pretty large (~1 MB) compared to its MOV version(~150 KB). It apparently didn’t compress as much as it should have and additionally, it had some problems like the text overlay shaking on the animation.

Turns out that there is something to do with GIF animation type. The file converted by FFmpeg is an overlay animation, which is the simplest type of frame optimized animation which is the default when converting a movie file to a GIF. Each frame of animation only overlays new pixels currently displayed.

Unfortunately, since the nature of a captured movie file is not an overlay animation, this type of optimizing operation can go badly wrong. However, we can convert it to coalesced animation that fills it out completely and displays full pixels each frames.

(images from http://www.imagemagick.org/Usage/anim_basics)

This type of animation is easier for later operations. It makes the optimized GIF smaller and preserves the quality. We can convert it just by adding a command line argument -coalesce to ImageMagick’s utility command convert.

This is an example command to convert a GIF to be a coalesced animation and put some text over it.

convert path/to/original/file \
          -coalesce \
          -gravity South \
          -fill white \
          -stroke black \
          -strokewidth 2 \
          -pointsize 24 \
          -annotate +0+10 "some text" \
        path/to/new/file
lang-bash

The shaking text problem is now solved and the GIF can be optimized much smaller than before :-)

Related Articles

How Can I Design a Software: A Beginners Guide for Business Owners

How Can I Design a Software: A Beginners Guide for Business Owners

Designing software is an exciting yet complex process that involves creativity, logical thinking, and problem-solving skills.

Read More →
The Future of Edge Computing: What Businesses Need to Know

The Future of Edge Computing: What Businesses Need to Know

The digital landscape is evolving rapidly, and businesses must adapt to keep up with rising demands for speed, efficiency, and real-time processing.

Read More →
The Future of Retail: AI, AR, and Digital Transformation Trends

The Future of Retail: AI, AR, and Digital Transformation Trends

Retail is evolving at an unprecedented pace, driven by AI (Artificial Intelligence), AR (Augmented Reality), and digital transformation technologies, revolutionizing the retail industry. Traditional brick-and-mortar stores are no longer just about selling products—they are becoming smart, interactiv

Read More →

Have a Project in Mind?

Let's discuss how we can help bring your ideas to life with our expertise in web and mobile development.

Start a Conversationhello@oozou.com
OOZOU Logo

Bangkok · Singapore · Hong Kong

X
Facebook
Instagram
LinkedIn

Services

  • Web Development
  • AI & Generative AI Solutions
  • Mobile App Development
  • Data Analytics & Engineering
  • UI/UX Design & Product Design
  • Digital Transformation

Company

  • About Us
  • Careers
  • Blog
  • Whitepapers
  • Case Studies
  • Today I Learned
  • Contact

More

  • Industries
  • Get an Estimate
  • Partner Network
© 2026 OOZOU. All rights reserved.
Privacy PolicyCode of ConductABAC Policy