| 
			
			 | 
		#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)  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,842 
				Karma: 105494725 
				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?  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | |
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,763 
				Karma: 24088559 
				Join Date: Dec 2010 
				
				
				
				Device: Kindle PW2 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 IMHO, you won't be able to create much smaller ebooks with KindleGen or Calibre.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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 ?  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#6 | |
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,842 
				Karma: 105494725 
				Join Date: Apr 2011 
				
				
				
				Device: pb360 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 kindlegen only converts to kindle formats, not from them.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,842 
				Karma: 105494725 
				Join Date: Apr 2011 
				
				
				
				Device: pb360 
				
				
				 | 
	
	|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 Resident Curmudgeon 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,782 
				Karma: 150249619 
				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.
		 
		
	
		
		
		
		
		
		
		
		
		
		
	
	 | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#9 | |
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,842 
				Karma: 105494725 
				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.  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#10 | |
| 
			
			
			
			 Resident Curmudgeon 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 80,782 
				Karma: 150249619 
				Join Date: Nov 2006 
				Location: Roslindale, Massachusetts 
				
				
				Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#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)  | 
|||
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#12 | |
| 
			
			
			
			 The Grand Mouse 高貴的老鼠 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 74,449 
				Karma: 318076944 
				Join Date: Jul 2007 
				Location: Norfolk, England 
				
				
				Device: Kindle Oasis 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#13 | |
| 
			
			
			
			 Bookmaker & Cat Slave 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503 
				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  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#14 | |||
| 
			
			
			
			 Wizard 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306 
				Karma: 13057279 
				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 01:02 PM | 
| Mobi to Azw3 Conversion - Unable to add/change covers | zaqxsw | Conversion | 6 | 12-15-2016 07:33 PM | 
| sorting algorithm author | Archimed | Library Management | 6 | 04-07-2014 04:45 PM | 
| Seriously thoughtful Dekker's Algorithm help. | Catire | Lounge | 13 | 03-19-2010 11:03 AM |