Page 2 of 2 FirstFirst 12
Results 31 to 49 of 49

Thread: defluff - a deflate huffman optimizer

  1. #31
    Member
    Join Date
    May 2008
    Location
    HK
    Posts
    160
    Thanks
    4
    Thanked 25 Times in 15 Posts
    *bump*
    any news of defluff?

  2. #32
    Member nikkho's Avatar
    Join Date
    Jul 2011
    Location
    Spain
    Posts
    546
    Thanks
    219
    Thanked 164 Times in 105 Posts
    Quote Originally Posted by roytam1 View Post
    *bump*
    any news of defluff?
    Same question here...

  3. #33
    Member
    Join Date
    Jul 2013
    Location
    UK
    Posts
    17
    Thanks
    5
    Thanked 1 Time in 1 Post
    *bump* again. I was unable to contact author via sourceforge e-mail. I'd love to see defluff released with a license that would allow me to reuse and redistribute it.

  4. #34
    Member
    Join Date
    May 2008
    Location
    HK
    Posts
    160
    Thanks
    4
    Thanked 25 Times in 15 Posts
    Quote Originally Posted by caveman View Post
    Joachim had you time to improve Defluff?
    I've started some preliminary work to update the zlib, I'd like to patch it to directly produce optimized Huffman trees (the same way Deflopt and Defluff do) a lot of apps could benefit from this. I know that Deflopt and Defluff do some tricks that go beyond simple Huffman trees optimizations (like replacing some LZ matches of length 3 by 3 literals) but it would still be a nice first step to get the smallest possible Huffman headers right from zlib.

    What I've done so far was to fix the way the lib computes the size of the blocks, it now keeps the length in bits for maximum precision. Next I will start to dump various Huffman headers to compare those produced by the lib and Deflopt/Defluff.

    If you disclose your code using a license compatible with zlib I could reuse your work and your name would of course be credited in the patch. This would help me a lot (and avoid me a few headache).
    and news about this patch?

  5. #35
    Member caveman's Avatar
    Join Date
    Jul 2009
    Location
    Strasbourg, France
    Posts
    190
    Thanks
    8
    Thanked 62 Times in 33 Posts
    Quote Originally Posted by roytam1 View Post
    and news about this patch?
    I had not much time working on it, but I've submited a small hack back in April to the zlib mailing list that saves 13 bytes on enwik8.

    http://mail.madler.net/pipermail/zli...il/003047.html

    This optimization is also done by defluff but not by deflopt.

    zlib trees.c replacement attached here.
    Attached Files Attached Files

  6. Thanks (2):

    lorents17 (5th January 2015),roytam1 (8th November 2013)

  7. #36
    Member
    Join Date
    Apr 2011
    Location
    Russia
    Posts
    168
    Thanks
    163
    Thanked 9 Times in 8 Posts
    Found a bug in the optimization of the image. As I understand the problem in Photoshop ICC profile.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	Truecolor.png 
Views:	393 
Size:	170.1 KB 
ID:	2652  

  8. #37
    Member
    Join Date
    Dec 2014
    Location
    Germany
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Could it be that defluff always discards the png pHYs chunk (cf. specification) specifying the physical pixel dimensions ("grep pHYs........." works for the input files, but not for the output generated by defluff)? In that case, is it possible to implement this as well as all existing tools that easily let you set/re-add this information seem to insist on also re-encoding the image data which of course defeats the purpose of using defluff in order to ensure that the output file is as small as possible?
    Last edited by m_ueberall; 26th December 2014 at 14:36. Reason: corrected hyperlink

  9. #38
    Member caveman's Avatar
    Join Date
    Jul 2009
    Location
    Strasbourg, France
    Posts
    190
    Thanks
    8
    Thanked 62 Times in 33 Posts
    Quote Originally Posted by m_ueberall View Post
    Could it be that defluff always discards the png pHYs chunk
    It does not:
    Code:
    $ pngcheck -v out2.png
    File: out2.png (66107 bytes)
      chunk IHDR at offset 0x0000c, length 13
        256 x 256 image, 24-bit RGB, non-interlaced
      chunk gAMA at offset 0x00025, length 4: 0.45455
      chunk pHYs at offset 0x00035, length 9: 2835x2835 pixels/meter (72 dpi)
      chunk tIME at offset 0x0004a, length 7:  2 Jan 2015 19:56:19 UTC
      chunk IDAT at offset 0x0005d, length 8192
        zlib: deflated, 32K window, maximum compression
      chunk IDAT at offset 0x02069, length 8192
      chunk IDAT at offset 0x04075, length 8192
      chunk IDAT at offset 0x06081, length 8192
      chunk IDAT at offset 0x0808d, length 8192
      chunk IDAT at offset 0x0a099, length 8192
      chunk IDAT at offset 0x0c0a5, length 8192
      chunk IDAT at offset 0x0e0b1, length 8192
      chunk IDAT at offset 0x100bd, length 362
      chunk IEND at offset 0x10233, length 0
    No errors detected in out2.png (14 chunks, 66.4% compression).
    
    $ defluff <out2.png >out3.png
    defluff 0.3.2
    Copyright (c) 2010-2011 Joachim Henke
    
    finished successfully
    
    $ pngcheck -v out3.pngFile: out3.png (65967 bytes)
      chunk IHDR at offset 0x0000c, length 13
        256 x 256 image, 24-bit RGB, non-interlaced
      chunk gAMA at offset 0x00025, length 4: 0.45455
      chunk pHYs at offset 0x00035, length 9: 2835x2835 pixels/meter (72 dpi)
      chunk tIME at offset 0x0004a, length 7:  2 Jan 2015 19:56:19 UTC
      chunk IDAT at offset 0x0005d, length 65854
        zlib: deflated, 32K window, maximum compression
      chunk IEND at offset 0x101a7, length 0
    No errors detected in out3.png (6 chunks, 66.4% compression).
    To my knowledge it merges IDAT chunks, does various optimizations in Deflate compressed chunks (removes some matches of length 3, Huffman header tweaking...) but leaves uncompressed chunks untouched.
    You can check if a pHYs chunk is present using pngcheck as shown here.

  10. #39
    Member
    Join Date
    Dec 2014
    Location
    Germany
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by caveman View Post
    It does not:
    ...
    To my knowledge it merges IDAT chunks, does various optimizations in Deflate compressed chunks (removes some matches of length 3, Huffman header tweaking...) but leaves uncompressed chunks untouched.
    You can check if a pHYs chunk is present using pngcheck as shown here.
    I stand corrected, sorry for the noise.
    Thanks a lot for the pointer to pngcheck--after looking at the script in question which actually invokes a number of different tools beforehand, the pHYs chunk was not removed by defluff, but by TruePNG (and only because I explicitly requested that using "-md remove all"). Last time I simply overlooked this preprocessing step--DOH.

    Kind regards, Markus
    Last edited by m_ueberall; 4th January 2015 at 14:33.

  11. #40
    Member
    Join Date
    Jul 2014
    Location
    Mars
    Posts
    180
    Thanks
    124
    Thanked 11 Times in 10 Posts
    src code?

  12. #41
    Member
    Join Date
    Jul 2016
    Location
    north pole
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I was hoping that you would let this program be repackaged and distributed. Do you give consent for such to happen? I didn't find a licence associated with the software.

  13. #42
    Member nikkho's Avatar
    Join Date
    Jul 2011
    Location
    Spain
    Posts
    546
    Thanks
    219
    Thanked 164 Times in 105 Posts
    Quote Originally Posted by drsassafras View Post
    I was hoping that you would let this program be repackaged and distributed. Do you give consent for such to happen? I didn't find a licence associated with the software.
    Being it posted as attachments in the forum, that is implying redistribution is allowed, I guess.

  14. #43
    Member
    Join Date
    Jul 2016
    Location
    north pole
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by nikkho View Post
    Being it posted as attachments in the forum, that is implying redistribution is allowed, I guess.
    Not good enough. It does not provide a legal framework for distribution. Copyright is still in the hands of the author, so distribution or even use of it would strictly speaking constitute a violation of copyright law. So if you used it you have broken the law. It matters more if redistribution starts to take place. (yes I know thats not what people do in an informal manner)

    Ive compared the PNG compression of what defluff can do with what ImageOptim application can achieve. Defluff can compress images further, even after ImageOptim has done its best. I contacted ImageOptim and asked if they wanted to integrate defluff into the application. There answer was yes, but it would have to be released under an open source licence for them to do so.
    Last edited by drsassafras; 6th July 2016 at 01:56.

  15. #44
    Member
    Join Date
    Mar 2016
    Location
    Croatia
    Posts
    184
    Thanks
    77
    Thanked 12 Times in 11 Posts
    would it get more compression after treating PNG with ECT ?

    For example, compress PNG with ECT, then compress with Defluff.

  16. #45
    Member nikkho's Avatar
    Join Date
    Jul 2011
    Location
    Spain
    Posts
    546
    Thanks
    219
    Thanked 164 Times in 105 Posts
    Quote Originally Posted by dado023 View Post
    would it get more compression after treating PNG with ECT ?

    For example, compress PNG with ECT, then compress with Defluff.
    Indeed that is what FileOptimizer does.

  17. Thanks:

    dado023 (5th July 2016)

  18. #46
    Member
    Join Date
    Mar 2016
    Location
    Croatia
    Posts
    184
    Thanks
    77
    Thanked 12 Times in 11 Posts
    Quote Originally Posted by nikkho View Post
    Indeed that is what FileOptimizer does.
    tnx Nikkho

    OT: will you soon have free time to churn out new latest and greatest Fileoptimizer version?

  19. #47
    Member nikkho's Avatar
    Join Date
    Jul 2011
    Location
    Spain
    Posts
    546
    Thanks
    219
    Thanked 164 Times in 105 Posts
    Quote Originally Posted by dado023 View Post
    tnx Nikkho

    OT: will you soon have free time to churn out new latest and greatest Fileoptimizer version?
    There has been some behind the scenes work: https://sourceforge.net/p/nikkhokkho/code/HEAD/tree/
    But not yet enought for a new release.

  20. #48
    Member
    Join Date
    Sep 2007
    Location
    Denmark
    Posts
    878
    Thanks
    51
    Thanked 106 Times in 84 Posts
    you should save the results from both aka

    the one after ECT
    and the one after ECT > efluff

    and mix the two together with cavemans huffmix..

    Huffmix is awesome when you are using diffent png optimization tools

  21. #49
    Member
    Join Date
    Nov 2018
    Location
    Spain
    Posts
    1
    Thanks
    0
    Thanked 2 Times in 1 Post
    Seems that defluff (both 32 & 64 bit versions) deletes some of my files on these two zip files I've attached. I don't know why, and I don't know if that could happen with other zip files.
    Attached Files Attached Files

  22. Thanks (2):

    Krishty (5th November 2019),nikkho (9th November 2018)

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Huffman code generator
    By Shelwien in forum Data Compression
    Replies: 2
    Last Post: 24th May 2011, 03:50
  2. Ultra7z Optimizer 0.12 is out
    By Surfer in forum Data Compression
    Replies: 13
    Last Post: 30th December 2010, 00:22
  3. huffman's Coding
    By swapy in forum Data Compression
    Replies: 5
    Last Post: 12th August 2009, 23:51
  4. help : Psd optimizer
    By Yuri Grille. in forum Data Compression
    Replies: 25
    Last Post: 25th April 2009, 10:29
  5. Advanced Huffman Encoding
    By Simon Berger in forum Data Compression
    Replies: 28
    Last Post: 15th April 2009, 15:24

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •