View Single Post
Old 06-30-2015, 08:01 AM   #7
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Fantastic work on this tutorial SBT. We need more helpful tutorials like this on the boards!

Quote:
Originally Posted by SBT View Post
You mention saving space. One trick I often use for B&W line drawings is to reduce the number of shades of gray. Fifty is ample ;-) That gives quite a saving, and personally I find it difficult to detect any degradation. However, I only know how to do this in ImageMagick; "mogrify -colors 50 image.png", though it must be possible to do the same in Gimp.
This is possible in GIMP by changing the image from Grayscale into an Indexed image.

Image > Mode > Indexed, and under "Generate optimum palette" you insert the number of colors you want to allow. So in your case, you would place 50 in the box.

Quote:
Originally Posted by DaleDe View Post
When working with binary it is usually more space efficient to use binary values. For example 2, 4, 8, 16, 32, 64 so 50 would not be as good a choice as 32 or 64 depending on how many shades you want. 50 is likely to take the same space as 64. 16 is all most e Ink readers support so even picking 16 will make it smaller and will likely display faster since less processing will be needed to reduce the image to 16.
The way that PNG compression works, the lower the amount of colors, the smaller the file size. 50 colors will be marginally smaller than 64.

If you continue to lower the amount of colors, and hit the "plateaus" of 2, 4, or 16 colors, that is where lowering the bit depth can kick in, and you can get much larger savings (although I would avoid lowering the bit depth to 2-bit or 4-bit, see topic below).

Quote:
Originally Posted by SBT View Post
You are of course quite correct that 16 shades will suffice on all present e-ink displays, but I've ended up using a bit more to be sure that the images look good on LCD's as well.

[...]

A word of warning: It is possible to tell PNG to use a specific bit depth (1,2,4,8,16), and save quite a few bytes. A lower bit depth can lead to trouble on certain devices – I believe this was discussed in a thread some time back, but I can't find it now.
You may want to avoid messing with the 2-bit (4 color) and 4-bit (16 color) PNGs. Here is the topic where GrannyGrump ran across a 4-bit PNG bug in the Sony Readers. I also posted some of my research on the topic, and a sample EPUB with different bit-depth PNGs for testing:

https://www.mobileread.com/forums/sho...d.php?t=222916

If you can, you would still want to save your 16 color images as 8-bit depth PNGs (instead of 4-bit depth).

Or you can always settle on something with <256 colors: 50 colors, 72, 150, or even 240. Heck, I settled on 17 colors as a "hackish" way to get around certain PNG compression tools lowering my bit depth from 8-bit!

Side Note: If you ever do need to find PNG info on MobileRead, you can always type in "ScriptPNG" or "Tex2002ans PNG", and you will come across posts about me discussing it over the years.

Last edited by Tex2002ans; 06-30-2015 at 08:19 AM.
Tex2002ans is offline   Reply With Quote