Please use the imageio plugin imageio-flif.
pyFLIF imports the FLIF library as a sub-module. Please have a look here for FLIF library dependencies.
- numpy:
sudo apt-get install python-numpy
(on debian/ubuntu) - scipy (optional):
sudo apt-get install python-scipy
(on debian/ubuntu) - opencv (optional):
sudo apt-get install python-opencv
(on debian/ubuntu)
git clone https://github.com/charun80/pyFLIF
cd pyFLIF
git submodule init
git submodule update
make
import pyFLIF
img = pyFLIF.imread( "path_to/image.flif" ) # numpy array with shape [ WxH(x3/4) ]
import pyFLIF
with pyFLIF.flifDecoder( "path_to/file.flif" ) as dec:
# decompressing all frames and storing them in a list
allframes = [ dec.getImage(idx) for idx in xrange(dec.numImages())
import pyFLIF
# img: numpy array with shape [ WxH(x3/4 ]
# dtype in (uint8, uint16)
pyFLIF.imwrite( "path_to/image.flif", img )
import pyFLIF
with pyFLIF.flifEncoder( "path_to/file.flif" ) as enc:
for img in <image source>:
# all img shall have same shape [ WxH(x3/4) ] and dtype (uint8/uint16)
enc.addImage( img )]