11-17-2019, 03:17 PM | #1 |
Junior Member
Posts: 9
Karma: 10
Join Date: Jan 2019
Device: Kindle Voyage
|
Change AZW3 compression algorithm?
Afaik AZW3 is based on mobi, wich uses probably deflate (?) to compress. Would it be possible to recompress/change the algorithm to PPMd?
The memory usage is one mb higher, but the compression is way better. (e.g 314KB only text in html > 179KB) |
11-17-2019, 04:10 PM | #2 |
Grand Sorcerer
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
|
kindlegen (which writes mobi and azw3) has 3 compression options:
-c0: no compression -c1: standard DOC compression -c2: Kindle huffdic compression What would be the point of using a compression that reading software does not handle? |
11-17-2019, 04:40 PM | #3 | |
Junior Member
Posts: 9
Karma: 10
Join Date: Jan 2019
Device: Kindle Voyage
|
Well, I didn't know there are two option to compress. Which one does calibre use to create azw3 files; Would it be possible to handle kindleGen a folder with azw3 structure to create an azw3, or can I only convert mobi and epub?
Quote:
I just want smaller files, I think 300kb for one book is quite alot. |
|
11-18-2019, 04:06 AM | #4 | |
Grand Sorcerer
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
IMHO, you won't be able to create much smaller ebooks with KindleGen or Calibre. |
|
11-18-2019, 04:39 AM | #5 | |
Wizard
Posts: 3,305
Karma: 10259306
Join Date: May 2016
Device: kobo forma, Kobo Libra, Huawei media Tab, fire HD10, PW3 HDX8.9,
|
Quote:
if you cant live with 300kb, buy shorter books you do realise that an e ink reader has enough storage for a few thousand 300Kb books ? lets say you improve the compression by 10% and save an amazing 30kb per book what could you possibly use that for ? |
|
11-18-2019, 11:18 AM | #6 | |
Grand Sorcerer
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
|
Quote:
kindlegen only converts to kindle formats, not from them. |
|
11-18-2019, 11:22 AM | #7 |
Grand Sorcerer
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
|
|
11-18-2019, 11:25 AM | #8 |
Resident Curmudgeon
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
One thing you should be aware of is that with higher compression comes more processor usage and more battery usage to decompress. It's not worth it for the pittance in space you'd save.
|
11-18-2019, 11:42 AM | #9 | |
Grand Sorcerer
Posts: 5,278
Karma: 98804578
Join Date: Apr 2011
Device: pb360
|
Quote:
A compression algorithm specialized for particular input data might produce smaller output while using less CPU than a general compression algorithm. It is very common for compression algorithms that squeeze out a bit more compression at the cost of a lot of CPU to have decompressors that use little or no additional CPU. |
|
11-18-2019, 08:58 PM | #10 | |
Resident Curmudgeon
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
11-18-2019, 09:15 PM | #11 | |||
Junior Member
Posts: 9
Karma: 10
Join Date: Jan 2019
Device: Kindle Voyage
|
Thank you all for responding
Quote:
Quote:
Quote:
And saving atleast 30kb on 10 books is one additional book (If we could use PPMd this would cut the size in half, allowing the doubble amount of books you could have without it) So is there any way to create myself a clean azw3 file, that atleast doesn't attempt to "fix" everything I do, or adding unused meta data every two steps. I would much prefer to reformate my files in vsCode and push it to phyton lib (or other valid opensource converter) |
|||
11-19-2019, 04:27 AM | #12 | |
The Grand Mouse 高貴的老鼠
Posts: 71,506
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
|
Quote:
|
|
11-19-2019, 08:46 AM | #13 | |
Bookmaker & Cat Slave
Posts: 11,462
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
Quote:
At my firm we take a few extra steps, for every book with images, using proprietary tools that we've developed and some tools that are available for anyone (like TinyPNG, which is awesome) to eliminate empty pixels and other wasted space in images. Amazon actually does a pretty incredible job of compression. But the better job you do beforehand, the easier their job is. Manga and other comic formats (yeah, yeah, I know, but let me lump them together for now) andif you want to save space, man, that's the place to start. IME and FWIW. Hitch |
|
11-19-2019, 06:08 PM | #14 | |||
Wizard
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Quote:
Like with PNG compression, there are a million valid ways to compress. Zopfli is an alternative very CPU-heavy algorithm Google came up with, but resulted in a smaller PNG (~3-8%) by selecting better parameters. Takes the same exact amount of resources to decompress it though. I gave some examples way back in 2013: https://www.mobileread.com/forums/sh...45#post2499645 (Since then, ScriptPNG has been superseded by pingo.) Quote:
If they're B&W/grayscale/<256-colors, you could also convert it to Indexed images for you and save A TON of space. (In the example linked above, my chart went from 143.1 KB -> 44.5 KB.) |
|||
Tags |
azw3, compression, ppmd |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Author Sort Name Algorithm Tweak | phossler | Calibre | 3 | 07-05-2018 12:02 PM |
Mobi to Azw3 Conversion - Unable to add/change covers | zaqxsw | Conversion | 6 | 12-15-2016 06:33 PM |
sorting algorithm author | Archimed | Library Management | 6 | 04-07-2014 03:45 PM |
Seriously thoughtful Dekker's Algorithm help. | Catire | Lounge | 13 | 03-19-2010 10:03 AM |