06-29-2015, 09:08 AM | #1 | |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
Image cleanup tips
This is a continuation of a discussion started on the "ebooks we're working on" thread:
Quote:
Short walk-through with gimp with G'MIC plugin installed: Used this image from "First crossing of Greenland", F. Nansen.
|
|
06-29-2015, 10:32 AM | #2 |
Guru
Posts: 970
Karma: 4999999
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
|
Very good!
Thanks for sharing this. |
Advert | |
|
06-29-2015, 01:40 PM | #3 |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I would recommend some additional touches.
First, convert the image to true grayscale (may save some bytes, speed up processing, and avoid adding unwanted colour): Image -> Mode -> Grayscale. Add a new black layer on top, and change its mode to "Burn" (I think that's the right English name, my Gimp is translated). This will show all the pixels either black or white, everything that's pure white in the image, stays white, but the slightest off-white becomes black. I find this very useful to detect noise and speckles that would be more noticeable in an e-ink screen. Make sure you select the bottom layer (the image), or add an empty intermediate layer (to make it easier to correct mistakes, compare before/after, etc.), and paint white the areas in the background that should be white. Zoom in if necessary. When in doubt whether a particular spot should be white or not, disable the black layer to see the real image, it should be clearer then. When you are done, disable or delete the black layer and save the cleaned up image. This is especially useful when you are going to make the background transparent, but in any case it will also save additional bytes (plain speckleless background compresses better). |
06-29-2015, 03:52 PM | #4 |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
Thanks, Jellby. Good suggestion.
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. I like keeping some kind of "source" images in full size, full colour, and then pass them through an Imagemagick command to shrink them, and possibly use pngcrush as well to save another few bytes, before I use them in the ebook. |
06-29-2015, 05:16 PM | #5 | |
Grand Sorcerer
Posts: 11,470
Karma: 13095790
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2 & Air 2, iPhone 7
|
Quote:
Dale |
|
Advert | |
|
06-29-2015, 05:42 PM | #6 |
Fanatic
Posts: 580
Karma: 810184
Join Date: Sep 2010
Location: Norway
Device: prs-t1, tablet, Nook Simple, assorted kindles, iPad
|
That's what I initially thought too, Dale. However, to me it seems like the PNG compression is so well thought out that it doesn't make much difference, and that the size reduction increases pretty smoothly with decreased colour space. OK, the number fifty was chosen mostly for comic relief, but using 48-64 shades seems adequate. 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. |
06-30-2015, 08:01 AM | #7 | |||
Wizard
Posts: 2,297
Karma: 12126329
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:
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:
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:
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. |
|||
06-30-2015, 08:31 AM | #8 |
frumious Bandersnatch
Posts: 7,515
Karma: 18512745
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I think I ran into some problem with this at some point. Maybe it reduced the bit depth of the final image, or maybe it was simply that it became inconvenient to work with indexed images afterwards. Another possibility is Colors > Posterize.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cleanup Authors | Niall | Library Management | 6 | 09-23-2014 06:42 PM |
authors cleanup | howi42 | Calibre | 2 | 09-23-2014 04:39 PM |
Temp files cleanup | kiwidude | Development | 2 | 03-05-2011 10:56 AM |
Any Cleanup tools | theducks | ePub | 2 | 09-10-2010 12:17 PM |