Ruby implementation of Melkman's algorithm with GIF animation