Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Workshop

Notices

Reply
 
Thread Tools Search this Thread
Old 11-29-2014, 06:04 PM   #1
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,487
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
ePUB Optimizer

Another small tool to help out. This program subsets fonts used in ePUB's (identical to the routines used in my FontShrinker program), but will also optimizes JPG, PNG and GIF images. The compression factor for the ePUB (or actually zip) will be maximized.

Latest version (currently 1.12) can be downloaded from my site or here. Usage is simple. Create an icon and just drop the ePUB on it or start via command tool.

There is also a Sigil plugin for this program. With that plugin this program can be called from within Sigil to update the images and fonts. The page for that plugin can be found here.

The program can also be run via Mono on Linux and OSX.

Last edited by Toxaris; 11-09-2015 at 12:07 PM.
Toxaris is offline   Reply With Quote
Old 11-29-2014, 07:40 PM   #2
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 10,394
Karma: 60950013
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Any chance of an option to convert from colour to gray scale for images?
PeterT is offline   Reply With Quote
Advert
Old 11-29-2014, 07:47 PM   #3
PeterT
Grand Sorcerer
PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.PeterT ought to be getting tired of karma fortunes by now.
 
PeterT's Avatar
 
Posts: 10,394
Karma: 60950013
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
Just tried it. Gor the following error at the end:
Code:
Unhandled Exception: System.UnauthorizedAccessException: Access to the path 'C:\Program Files (x86)\Toxaris\ePUBOptimizer\actionlist.txt' is denied.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access,
FileShare share, Int32 bufferSize, FileOptions options, String msgPath, BooleanbFromProxy, Boolean useLongPath, Boolean checkHost)
   at System.IO.StreamWriter.CreateFile(String path, Boolean append, Boolean checkHost)
   at System.IO.StreamWriter..ctor(String path, Boolean append, Encoding encoding, Int32 bufferSize, Boolean checkHost)
   at System.IO.File.InternalWriteAllText(String path, String contents, Encoding encoding, Boolean checkHost)
   at System.IO.File.WriteAllText(String path, String contents)
   at Toxaris.ToxarisUtils.OperationsIO.WriteStr2File(String FileName, String Text)
   at ePUBOptimizer.Module1.HandleePUB(String ePUB)
   at ePUBOptimizer.Module1.Main()

C:\Users\Peter\Documents\Peter's Library\Yvonne Stephens\Amazing 7 Minute Meals_ Over 100 Recipes (1471)>
PeterT is offline   Reply With Quote
Old 11-30-2014, 07:37 AM   #4
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,487
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Hmm, that is strange. The application should be able to write in its own directory. No worry, I will adapt this to make sure it will work. Probably later today.

I will look into the grayscale thing, but I am not too sure. I want to make it lean and mean without too much options. Have to think about it.
Toxaris is offline   Reply With Quote
Old 12-01-2014, 06:42 AM   #5
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,487
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Small update where the write error is solved and better handling of media queries.
Toxaris is offline   Reply With Quote
Advert
Old 12-02-2014, 06:06 AM   #6
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,487
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
And again a new version to which an option is added. This option actually controls the way the subsetting will be done. If the -f option is given, the glyphs to be retained are calculated based on the complete font-family instead of just for that font. This can cause that more glyphs are retained, but will ensure that a font that is improper used will be deleted.
Toxaris is offline   Reply With Quote
Old 12-16-2014, 02:41 PM   #7
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,487
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Updated version. Various enhancements and fixes, such as improved performance and included helper applications for OSX as well.
Toxaris is offline   Reply With Quote
Old 01-27-2015, 05:15 PM   #8
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,487
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
New version is out. Besides solving a serious bug there is a change in the way of working. If from one font family multiple fonts are delivered, the actual usage per font is checked. However, if only one font for that font family is delivered, the usage of the complete font family is checked, not taking bold/italic into account. This is less strict perhaps, but resembles more the actual usage of fonts in ePUB I guess.
Toxaris is offline   Reply With Quote
Old 02-06-2015, 04:38 AM   #9
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 1,917
Karma: 18487193
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
Hi Toxaris. Could you give a bit of detail about the specific ways the images are optimized? That is, do you use only a stronger file-compression algorithm?
Or does it reduce bit-depth for pngs, increase compression (lower "quality setting") of jpegs?

Thanks.
GrannyGrump is offline   Reply With Quote
Old 02-06-2015, 07:47 AM   #10
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,487
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-300, PRS-T1
Sure, for JPEG I use JPEGTRAN and for PNG I use OPTIPNG. I do not change the compression value for JPEG, because that can cause quite some unexpected results. That should be done manually.

Most is removal of unused information/data and reduction of depths and alike. If you would like, I can give the exact parameters I feed into these programs.
Toxaris is offline   Reply With Quote
Old 02-06-2015, 09:45 AM   #11
Freeshadow
temp. out of service
Freeshadow ought to be getting tired of karma fortunes by now.Freeshadow ought to be getting tired of karma fortunes by now.Freeshadow ought to be getting tired of karma fortunes by now.Freeshadow ought to be getting tired of karma fortunes by now.Freeshadow ought to be getting tired of karma fortunes by now.Freeshadow ought to be getting tired of karma fortunes by now.Freeshadow ought to be getting tired of karma fortunes by now.Freeshadow ought to be getting tired of karma fortunes by now.Freeshadow ought to be getting tired of karma fortunes by now.Freeshadow ought to be getting tired of karma fortunes by now.Freeshadow ought to be getting tired of karma fortunes by now.
 
Posts: 2,721
Karma: 20781888
Join Date: May 2010
Location: Duisburg (DE)
Device: PB 623
Thumbs up

Some ideas:
For metadata removal only you could use jpegoptim too.
Similar could be done with SVG: http://code.google.com/p/svgmin/
Ruben found out that extracting the SVG code from the file and inline embedding it directly into the epub makes significantly smaller files too. It would be worth to check back with Hitch how different reading systems react to inline svg code.

Are you recompressing with Zopfli?
AdvanceCOMP:
Advpng for the images;
Advzip for the finished epubs.

When I was digging for shrinking tools for Hitch I also searched for minification tools which could be applied to the epub's CSS and sources, but found only *. js stuff for use with webservers. Have no idea how to utilise it. Minification could be worth being looked up too.

Apart from that - what you are doing here: intelligent standalone tools for font subsetting; storage footprint optimisation (I'm a compression fan myself ) - what you do is exactly literally what I had in mind. It's development in the direction that matters. Bleeding edge, tailor made best possible epubs. Kudos and big big thanks for what you do.
Freeshadow is offline   Reply With Quote
Old 02-06-2015, 10:07 AM   #12
GrannyGrump
Obsessively Dedicated...
GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.GrannyGrump ought to be getting tired of karma fortunes by now.
 
GrannyGrump's Avatar
 
Posts: 1,917
Karma: 18487193
Join Date: May 2011
Location: JAPAN (US expatriate)
Device: Sony PRS-T2, ADE on PC
@Toxaris, Yes, please do share your parameters. I am looking for ways to get smaller image files, because it seems like every project I start on a whim turns out to be very image-heavy. Especially now, when I have decided to go with higher-resolution images instead of 600x800.

Quite some time ago, I tried out ScriptPng (Tex2002ans recommendation on several threads), and it does a nice job. But you have to watch the parameters, as it tends to reduce bit-depth to 4-bit, which would not display properly in some Sony devices due to a Sony bug.

Love your tools! Greatly appreciated!
GrannyGrump is offline   Reply With Quote
Old 02-06-2015, 11:42 AM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 52,427
Karma: 47532469
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Quote:
Originally Posted by GrannyGrump View Post
@Toxaris, Yes, please do share your parameters. I am looking for ways to get smaller image files, because it seems like every project I start on a whim turns out to be very image-heavy. Especially now, when I have decided to go with higher-resolution images instead of 600x800.

Quite some time ago, I tried out ScriptPng (Tex2002ans recommendation on several threads), and it does a nice job. But you have to watch the parameters, as it tends to reduce bit-depth to 4-bit, which would not display properly in some Sony devices due to a Sony bug.

Love your tools! Greatly appreciated!
There is a way to optimize JPG images even more than is done with ePUB Optimizer. That requires using jpegtran with a specific scan order for RGB jpeg and a specific scan order for greyscale jpg. But you have to be careful. Using the wrong scan order will cause your image to be 0 bytes.

If you want to know about this, I can post what you is needed to get that extra bit reduced.
JSWolf is offline   Reply With Quote
Old 02-06-2015, 11:49 AM   #14
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,247
Karma: 83049305
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
I get great results out of zopflipng -- just remember to set it going overnight it takes a while.
eschwartz is offline   Reply With Quote
Old 02-06-2015, 12:05 PM   #15
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 52,427
Karma: 47532469
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Aura H2O, Sony PRS-650, Sony PRS-T1, nook STR, iPad 4, iPhone 5
Quote:
Originally Posted by eschwartz View Post
I get great results out of zopflipng -- just remember to set it going overnight it takes a while.
I get even better results converting to JPG as most time, the images in PNG don't need to be PNG.
JSWolf is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ePUB Optimizer Toxaris Plugins 132 04-14-2018 04:02 PM
Comic optimizer script rhon Kobo Reader 0 11-08-2012 07:04 PM
Mokle - Mangas Optimizer for Kindle devorez Kindle Developer's Corner 11 08-14-2012 08:15 PM
Patent/Heavy graphics pdfs and Adobe PDF Optimizer andrewscheinman iRex 4 12-26-2009 12:39 PM
PRS-500 PDF file optimizer phigdon Sony Reader Dev Corner 1 04-02-2007 12:40 AM


All times are GMT -4. The time now is 06:22 PM.


MobileRead.com is a privately owned, operated and funded community.