Skip to content

@hrj hrj released this Aug 15, 2017

Bug fix release. There was a major (yet silly) bug in the high level API, which caused FLIF decoding to fail for all files that were loaded through the high-level API! 👀

Assets 4

@hrj hrj released this Jul 5, 2017


  • The low level API now has an extra parameter to enable/disable previews. Disabling previews in PolyFLIF is useful, for example, when another library is already providing previews. For example, leaflet.js provides the previews in this demo when zooming in.
  • Merged upstream FLIF code until commit c17459b

The API docs have been updated.

Assets 4

@hrj hrj released this Apr 27, 2017

A major release that brings support for Webworkers and Progressive decoding!

  • When web-worker support is available in the browser, PolyFLIF now decodes in a separate worker thread, one for each image. This frees up the main browser thread, preventing UI lock ups. It also improves throughput when multiple CPU cores are available in the system.
  • When web-workers are being used, the image is decoded progressively and previews are shown whenever more than 0.6 seconds have elapsed. (A lot of this will be configurable in the next release.)
  • Lots of fixes and optimisations were done to the preview generation code in upstream repository and merged into PolyFLIF. Some changes are waiting to be merged in upstream FLIF code, but have been merged into this PolyFLIF release.

The next release will be focussed on configurability.

Assets 4

@hrj hrj released this Apr 6, 2017

I ❤️ optimising things, so I am pleased to present a new release which is 1.5x to 2x faster!


  • The static-only variant now has a smaller heap; 20MB v/s 100MB for the full version. The 20MB heap is sufficient for images of geometry upto ~2000 x ~2000. It is also feasible to change this in run-time, but I need to bring it out to the API. #36
  • Optimisations in the C to Javascript interfaces. Drawing to canvas and reading the input stream has to cross the C <> Javascript bridge. This was very expensive, so I have essentially added a small buffer, which has a not-so-small impact.
Assets 4

@hrj hrj released this Mar 17, 2017


  • Updated to latest upstream code
  • Added a variant that doesn't support animations. Has smaller JS payload. #33
Assets 4

@hrj hrj released this Jan 12, 2017

  • Major bug fix #32.
    The IO code was reporting EOF a bit pre-maturely. Typically, just one byte was lost. But since FLIF is densely packed, this loss of one byte could affect a whole row of pixels.
  • The low level API was slightly changed to improve precision and clarity. If you don't use the low-level API this change has no impact for you. The truncation parameter had a percentage unit. Now there are two APIs: one which retrains the percentage unit, and another which uses a byte count. The API doc has been updated accordingly.
Assets 4

@hrj hrj released this Jan 11, 2017

  • Merge with upstream FLIF code. Fixes some issues, such as #30

  • Improved scaling. The library now tries to match the specified size exactly. See #28

    Scaling will be improved further, in a future release. See #31

The API doc and samples page have been also improved a bit, by elaborating on the options.

Assets 4
Nov 8, 2016
Better lossy encoding. Thanks to hrj (#315) for some of the ideas.

@hrj hrj released this Nov 3, 2016

  • Updated decoder to upstream master. It now decodes the (recently finalized) FLIF16 bitstream format correctly.
  • Fixed handling of grayscale images (#26)
Assets 3

@hrj hrj released this Jun 26, 2016

New features

  • Support for decoding to CSS background image
  • Support for partial loading and decoding

Docs and demo

Read about the API and view the sample page.

Assets 3