RSS Feed

Lisp Project of the Day

trivial-thumbnail

You can support this project by donating at:

Donate using PatreonDonate using Liberapay

Or see the list of project sponsors.

trivial-thumbnailtrivialgraphics

Documentation😀
Docstrings😀
Tests 🥺
Examples😀
RepositoryActivity🥺
CI 🥺

This is the library by @Shinmera. It does one trivial thing - shrinks images, squeezes them into smaller thumbnails. Actually, it is a wrapper around ImageMagick.

The cool thing about this library is that it is able to preserve GIF animations. This way you can create animated avatars for users of your next-generation Facebook killer social network, written in Common Lisp!

For example, let's pretend the user loads this cute dog animation which has 800×800 pixels size, and weights 44KB:

If we want our avatars to be 64x64 pixels, then trivial-thumbnail will help us:

POFTHEDAY> (trivial-thumbnail:create "docs/media/0200/dog.gif"
                                     "docs/media/0200/small-dog.gif"
                                     :width 64)
#P"docs/media/0200/small-dog.gif"

Here is the result:

To make it work you have to install ImageMagick. On OSX the easiest way to do this is to use Homebrew:

brew install imagemagick

There are also other options. They are covered by documentation.

Seems this is a cool library to make avatars, preview and thumbnails.


Brought to you by 40Ants under Creative Commons License