Skip to content

hrj/t-flif

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

t-flif

Support for tiled FLIF images. With the help of t-flif, a large image can be stored as a 2D matrix of tiles and a sub-image can be decoded on the fly.

Advantages

Why use tiles? The FLIF format (as of writing) interweaves pixel and bit data from all over the image. Hence it is not possible to decode only a sub-region of a FLIF image. Nor is it possible to parallelise the decoding of a single FLIF file.

By splitting the image into smaller tiles, only the required subset of data can be decoded and it can be decoded in parallel, utilising all the processing cores available in the CPU. Moreover, sub-regions of the image can be updated by re-encoding and updating only the relevant tiles.

Status

This is a very early, but useable, prototype. It is a peg in the ground to collect more feedback and to evolve the idea further.

Currently, this tool just calls the FLIF CLI tools for decoding, but that will change later. In fact, a lot of the implementation details will change later.

How to use

  • Install FLIF CLI tool such that it is available in $PATH
  • Create the tiles. The misc/create-tiles.sh script is provided for convenience.
  • Install sbt (Scala build tool)
  • Type sbt run --help for the command line help. The various options define the size and location of tiles, the dimensions of the subimage and other decoding options.

Features

  • Decode an arbitrary sub-image of the tile-set
  • Supports down sampling the image while decoding

Roadmap

Immediate

Long term

  • Javascript version of t-flif using ScalaJS and PolyFLIF.
  • More complex optimisations, such as embedding the decoder, using a low-level language, etc
  • Support for more image formats
  • Fast re-encoding of output in FLIF format

Copyright and License

Copyright 2017 Harshad RJ

Licensed under Apache V2 (See LICENSE.txt)