Free Lossless Image Format (FLIF)

Discussion in 'Offtopic Discussions' started by _wb_, Sep 6, 2015.

  1. ible

    ible professional vim user

    Joined:
    Mar 24, 2014
    Messages:
    2,174
    Location:
    Seattle, WA
    oh no, no, you are quite incorrect. _wb_ thought about doing something fancier at some point...
    https://pyra-handheld.com/boards/threads/free-lossless-image-format-flif.76305/page-8#post-1352448

    and then he did it: (one shared MANIAC tree).
    https://pyra-handheld.com/boards/threads/free-lossless-image-format-flif.76305/page-15#post-1383910
     
    Last edited: Jun 25, 2016
  2. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    11,231
    Location:
    Somewhere off the coast of the EU
    Nice digging :)
     
  3. ible

    ible professional vim user

    Joined:
    Mar 24, 2014
    Messages:
    2,174
    Location:
    Seattle, WA
    thankfully the search function on these forums isn't too bad ;)
     
    levi likes this.
  4. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    11,231
    Location:
    Somewhere off the coast of the EU
    That 'download a series of 1s FLIF file' idea is actually quite a neat way to implement a video client-server algorithm with just a bit of code on the client side and a standard web server on the other. Start by downloading the first few seconds in parallel (and after a short delay, start showing the first one) then every second start the download of another second in the background. The lookahead could be configurable in case you're on a spotty connection (on a train going through tunnels for example), and the client could stop downloads early even if there's enough bandwidth to download more if it's on a per MB costed line.
     
    Silent-Hunter and _wb_ like this.
  5. Silent-Hunter

    Silent-Hunter Hardcore Member

    Joined:
    May 29, 2010
    Messages:
    3,053
    How would you sync the audio to the video though?

    Thanks for making this @_wb_ !
     
    levi likes this.
  6. _wb_

    _wb_ Microbe Staff Member

    Joined:
    Apr 5, 2012
    Messages:
    5,387
    Location:
    Brussels, Belgium
    Animated FLIF uses one shared MANIAC tree (or rather a forest: it's one tree per color channel) for the entire animation. So if it learns correlations in one frame, it helps to compress other frames.

    It also has some intra-frame optimizations: FrameShape, a Lookback channel, duplicate frame detection. Still nothing compared to what actual video codecs do (e.g. no motion vectors etc), but more than what APNG/GIF do.

    For lossless video, I suppose FLIF is mostly like FFV1, but with slightly better compression and with progressive rendering.
    Since the entire animation has to fit in memory, you would indeed need to split it in small chunks, especially if it's high resolution.
     
    ElPoco, levi and ible like this.
  7. ible

    ible professional vim user

    Joined:
    Mar 24, 2014
    Messages:
    2,174
    Location:
    Seattle, WA
    ok, that's what i thought, so take that @levi! i take back my earlier withdrawal ;).
     
    levi likes this.
  8. comradekingu

    comradekingu Glowing ember

    Joined:
    Apr 15, 2011
    Messages:
    4,968
    @_wb_

    I feel the paper needs more logo and less @gmail-ing.
    Reworked the text and sent to cloudinary email.
     
  9. Magic Sam

    Magic Sam Forever Homebrew

    Joined:
    Aug 10, 2007
    Messages:
    2,214
    Location:
    Innsmouth, MA
    Hi all :)

    Dropbox has open sourced Lepton, its lossless file format.

    @_wb_ : Dropbox may also be interested in FLIF, don't you think ?

    Cheers, Magic Sam
     
  10. Magic Sam

    Magic Sam Forever Homebrew

    Joined:
    Aug 10, 2007
    Messages:
    2,214
    Location:
    Innsmouth, MA
    FBnil, ingoreis and ible like this.
  11. levi

    levi Still fresh, damnit!

    Joined:
    Oct 6, 2008
    Messages:
    11,231
    Location:
    Somewhere off the coast of the EU
    Wow, there have been a lot of changes on the git for this since I last did a git pull on it.

    Edit: Those 16x16 renders of Haiku icons look awfully smooth. Bitmaps have their uses on low-res screens, though perhaps that's less of a concern than it used to be.
     
    Last edited: Sep 6, 2016
  12. _wb_

    _wb_ Microbe Staff Member

    Joined:
    Apr 5, 2012
    Messages:
    5,387
    Location:
    Brussels, Belgium
    FLIF is doing fine. Software support is indeed growing, e.g. ImageMagick supports it too now, and there's also a Windows codec for it. Too bad I didn't find time yet to add FLIF support to PIV -- to be honest, I'm not using my Pandora that often anymore since I stopped commuting to work (which was usually 2 hours of Pandora time). I'm working from home now. Also, the format has been evolving over the past months, so it probably does not make sense to build it into PIV until the format is stable.

    I'm going to present FLIF at the ICIP 2016 conference (see http://2016.ieeeicip.org/Papers/PublicSessionIndex3.asp?Sessionid=1156), and I'm planning to release a stable version of the format by then.
     
    FBnil, Neelix, PokeParadox and 7 others like this.
  13. Silent-Hunter

    Silent-Hunter Hardcore Member

    Joined:
    May 29, 2010
    Messages:
    3,053
    Can this be added to XFCE and maybe the Eye of Mate/GNOME image viewers? I'd love to be able to use it for backgrounds and stuff.
     
  14. _jr_

    _jr_ Advanced Member

    Joined:
    May 5, 2013
    Messages:
    1,170
  15. _wb_

    _wb_ Microbe Staff Member

    Joined:
    Apr 5, 2012
    Messages:
    5,387
    Location:
    Brussels, Belgium
    Of course that can be done, but somebody still needs to do it :)

    Here's an overview of FLIF software support, which I try to keep up to date:
    http://flif.info/software.html

    There is a plugin for Qt4 / Qt5 (KDE), but none so far afaik for GTK (GNOME). It should in principle not be particularly hard to add support for a new image format to all of those frameworks / toolkits, using libflif it's just a few lines of code probably. But somebody has to do it. Feel free to send feature requests to all the projects/programs you want to have FLIF support in :)
     
  16. Magic Sam

    Magic Sam Forever Homebrew

    Joined:
    Aug 10, 2007
    Messages:
    2,214
    Location:
    Innsmouth, MA
    Hi all !

    @_wb_ : done for Otter Browser ;)

    EDIT: reply was quick...
    EDIT: hopefully our great @ptitSeb will do marvels (again) :D

    EDIT: @_wb_ : FLIF has already been mentioned in GNOME's Bugzilla (Bug #770005) :)

    Cheers, Magic Sam
     
    Last edited: Sep 9, 2016
  17. Silent-Hunter

    Silent-Hunter Hardcore Member

    Joined:
    May 29, 2010
    Messages:
    3,053
    I might just try and learn how to add it myself. But I'll wait until it is finished first yeah?
     
  18. _wb_

    _wb_ Microbe Staff Member

    Joined:
    Apr 5, 2012
    Messages:
    5,387
    Location:
    Brussels, Belgium
    No need to wait, if you start now, then if needed the libflif API can still be tweaked :)
     
  19. Silent-Hunter

    Silent-Hunter Hardcore Member

    Joined:
    May 29, 2010
    Messages:
    3,053
    Alright, I'll look into it. I'm still learning though so it might be quite a while. XD
     
  20. ptitSeb

    ptitSeb Serial Porter

    Joined:
    Aug 15, 2012
    Messages:
    8,408
    Location:
    France, near Lyon
    Mmmm, I tried to compile libflif and the flif tools from main github.
    It compiled fine (with no error or warning), but try to compress a png file to flif gives me a load of
    Code:
    Corruption detected!
    
    I'm compiling with gcc 6.2.0 and, if first tried to add
    Code:
    -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp
    
    and then
    Code:
    -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fsigned-char -fno-fast-math -fno-single-precision-constant -fno-delete-null-pointer-checks
    
    to CXXFLAGS, but same result.
    reading back the generated flif fail, it really seems corrupted:
    Code:
    Decoding progressively...
    Invalid tree. Aborting tree decoding.
    File probably truncated in the middle of MANIAC tree representation. Interpolating.
    1052 bytes read, rendering at quality=0.39%
    
    I'll try to debug a bit more tomorrow, it's too late for that now.
     

Share This Page

Loading...