Results 1 to 4 of 4

Thread: Images PreProcessor - PrePNG

  1. #1
    Member PAQer's Avatar
    Join Date
    Jan 2010
    Location
    Russia
    Posts
    22
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Images PreProcessor - PrePNG

    PrePNG is simple program - just recreate png images without compression, but with forcing filtration (delta, average & Paeth Predictor). Output format, of course, is png too. In most cases (not always) of my tests it's better than FreeARC's MM-filter or nanozip's graphics filter. Processing speed is around as lzma decomp speed. Drag'n drop works too.
    On images like "rafale.bmp", which do not require filtration, that stuff doesn't help.

    Chain of PrePNG+BCM sometimes compress better than JPEG2k or a little worse. Also, lc8 param in lzma, greatly improve compression in most cases.

    RGB Image (24 bit, 1024x768, 2 359 350 bytes):

    -7z = 918898
    -rar = 860522
    -bcm = 769808
    -JPG2k = 616074 (lossless)

    MM:c3:w8+
    -7z = 768540 (lzma)
    -FreeARC = 730212 (lzma with lc8 option)
    -FreeARC = 686405 (grzip:l)
    -BCM = 657962

    PrePNG+
    -7z = 717447
    -FreeARC = 683720 (lzma:lc
    -FreeARC = 632793 (grzip:l)
    -BCM = 610364

    Heavy artillery:
    -BMF 1.1 = 489868 (-s -f -q9)
    -PAQ8px = 460780 (-4) 6* version, don't remember exactly.
    -BMF 2009 = 427484 (-s -q9)
    -------------------------------------

    File "BIG.png" from Gralic thread:
    PNM: 4 747 457 bytes
    PNG: 1 882 722 bytes
    JBG: 1 797 888 bytes
    7Z: 1 596 148 bytes
    GRALIC: 1 346 379 bytes (4 s)
    PAQ8PX: 1 271 445 bytes (143 s)
    BCMed:
    PrePNG: 1 451 100 bytes
    BMP: 1 812 827 bytes

    7zip'ed:
    PrePNG+7z: 1 728 496 bytes (worse than bmp+7z)
    PrePNG+Freearc: 1*647*664 (lzma:lc
    Attached Files Attached Files

  2. #2
    Programmer schnaader's Avatar
    Join Date
    May 2008
    Location
    Hessen, Germany
    Posts
    539
    Thanks
    192
    Thanked 174 Times in 81 Posts
    Quote Originally Posted by PAQer View Post
    PrePNG is simple program - just recreate png images without compression, but with forcing filtration (delta, average & Paeth Predictor).
    Nice tool. This is perfect to get better compression for PNG files if bitwise lossless reconstruction of the original PNG file isn't needed. Also, forcing filtration seems to help for many images and the PNG metadata seems to be preserved.

    About the metadata/non-image data chunks: Most of them are compressed with zLib and stay like this. It might be useful to use uncompressed zLib streams (Z_NO_COMPRESSION) or uncompress the data for the chunks that support this (like iTXt). Anyway, this won't make a big difference for most pictures as most of these chunks are quite small in size, except for the unofficial prVW/pRVW chunk (link).

    As you already said, in some cases, forcing filtration hurts compression, so you could add an optional switch to use no filtration at all. I also thought about keeping or forcing filtration in Precomp, but my experiments led to very mixed results so I decided to use the uncompressed and unfiltered image data.

    A nice extension would be combining it with some efficient image compression and some PNG tool like PNGOUT to get a fully automated script/tool. This could compress PNG images to something like (PrePNG+7z) and use PNGOUT after decompression to get the result as small (or even smaller) as the original PNG file.
    Last edited by schnaader; 17th May 2010 at 23:25.
    http://schnaader.info
    Damn kids. They're all alike.

  3. #3
    Member PAQer's Avatar
    Join Date
    Jan 2010
    Location
    Russia
    Posts
    22
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by schnaader View Post
    As you already said, in some cases, forcing filtration hurts compression, so you could add an optional switch to use no filtration at all. I also thought about keeping or forcing filtration in Precomp, but my experiments led to very mixed results so I decided to use the uncompressed and unfiltered image data.
    I can add optional switch, of course (manual), but will be better implement something like an automatical entropy alanyser or may be just calculate differents color counts.
    Anyway it's demostration, how modern compression algorithms can win with old PNG's filtration.
    Adding PNG-filtration to Precomp will be awesome thing, and not only for PNG-images: detected BMPs, TGAs, Icons.

    Quote Originally Posted by schnaader View Post
    A nice extension would be combining it with some efficient image compression and some PNG tool like PNGOUT to get a fully automated script/tool. This could compress PNG images to something like (PrePNG+7z) and use PNGOUT after decompression to get the result as small (or even smaller) as the original PNG file.
    I'm also trying to get same effect as PrePNG with PNGOut, but no luck.

    We already have very good images compressor - BMF (in some cases better than PAQ8px up to 10%), already support 32bit tga (no alpha support in PAQ) output. Need only - tga2png final processing or png native support by BMF.

    Also, not least reason here - solid compression. Good images compressors/archievers like stuffit, BMF, doesn't support solid mode. Yes. PAQ8 supports, but speed like hell.

  4. #4
    Member Raymond_NGhM's Avatar
    Join Date
    Oct 2008
    Location
    UK
    Posts
    51
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    To achieve compression rato a little (or maybe a bit faster),
    for all image formats on LZMA method,
    remove "Pos Bits" value (PB=0), cause default mode is 2.
    Last edited by Raymond_NGhM; 21st May 2010 at 14:51.

Similar Threads

  1. Dict preprocessor
    By pat357 in forum Data Compression
    Replies: 5
    Last Post: 2nd May 2014, 21:51
  2. Idea for raising compression efficiency on disk images
    By Mexxi in forum Data Compression
    Replies: 10
    Last Post: 18th February 2010, 05:56
  3. Replies: 1
    Last Post: 13th May 2009, 10:46
  4. Precompression of Tiff Images
    By Simon Berger in forum Data Compression
    Replies: 52
    Last Post: 8th May 2009, 00:14
  5. Compression used in .wim (Vista) images
    By jaclaz in forum Data Compression
    Replies: 9
    Last Post: 29th August 2008, 18:05

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
  •