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

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 02-28-2016, 12:21 PM   #1
Libron
Member
Libron began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Feb 2016
Device: Kindle 5, Kobo Glo HD
Inverting cover color.

I like using nightmode, however the downside is that cover color also gets inverted. Is there a way to easily invert cover color in Calibre or maybe to add some css that would nulify nightmode when it comes to cover, but not for the rest of the text?
Libron is offline   Reply With Quote
Old 02-28-2016, 02:36 PM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 19,405
Karma: 18898264
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Astak Pocket Pro, K4NT,Galaxy Tab 2
there is no
display: Nightmode (or similar0
e-book standard

You would think that after all these years, that we would actually have meaningful (to users) standards. EPUB3 fell out of the 500lb Gorilla tree

RIAA created a standard for the recording industry (up till then, every lable had its own compensation curve)
The video (TV/Movie) industry has standards
Even the power company has (country specific) standards for Voltage, Frequency and power plugs

Not e-books
theducks is offline   Reply With Quote
 
Advertisement
Old 02-28-2016, 10:08 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 29,379
Karma: 7472601
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I'm not sure what you are asking. You can define your own color themes for the viewer, and those color themes do not affect the colors of images.
kovidgoyal is offline   Reply With Quote
Old 02-29-2016, 01:07 AM   #4
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 10,203
Karma: 15432825
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo: Touch, Glo, Aura H2O, Glo HD
Libron is talking about on an ereader device. Someone has made a patch for the Kobo devices to reverse the colours. So, instead of black text on a white screen, it is white text on black. But, it does this by reversing everything, so the covers and pictures in books appear as negatives. I think Libron wants an easy way to invert the images before sending them to a device so they will appear correctly on the device when using "night mode".

Libron: Assuming you are doing this for your Glo HD, a quick search found:

Code:
img {
   -webkit-filter: invert(1);
   filter: invert(1);
   }
That is supposed to be CSS3 and supported by webkit based browsers. From memory, the kepub renderer is webkit based, so it might work. You can try putting that into a "kobo_extra.css" file on the device, enabling the option to modify CSS in the driver and sending a book as a kepub (either convert to kepub or use the extended driver - either way will need extra plugins in calibre).
davidfor is offline   Reply With Quote
Old 02-29-2016, 06:06 AM   #5
Libron
Member
Libron began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Feb 2016
Device: Kindle 5, Kobo Glo HD
Quote:
Originally Posted by davidfor View Post
Libron is talking about on an ereader device. Someone has made a patch for the Kobo devices to reverse the colours. So, instead of black text on a white screen, it is white text on black. But, it does this by reversing everything, so the covers and pictures in books appear as negatives. I think Libron wants an easy way to invert the images before sending them to a device so they will appear correctly on the device when using "night mode".

Libron: Assuming you are doing this for your Glo HD, a quick search found:

Code:
img {
   -webkit-filter: invert(1);
   filter: invert(1);
   }
That is supposed to be CSS3 and supported by webkit based browsers. From memory, the kepub renderer is webkit based, so it might work. You can try putting that into a "kobo_extra.css" file on the device, enabling the option to modify CSS in the driver and sending a book as a kepub (either convert to kepub or use the extended driver - either way will need extra plugins in calibre).
Thanks for the reply. I can't find "kobo_extra.css" on my e-reader, even when I check my Win to show hidden and system files/folders. There are a bunch of css files, but none with that name (see: attachment).
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 02-29-16.PNG
Views:	85
Size:	10.5 KB
ID:	146777  
Libron is offline   Reply With Quote
Old 02-29-2016, 06:54 AM   #6
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 10,203
Karma: 15432825
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo: Touch, Glo, Aura H2O, Glo HD
Quote:
Originally Posted by Libron View Post
Thanks for the reply. I can't find "kobo_extra.css" on my e-reader, even when I check my Win to show hidden and system files/folders.
And I wouldn't expect you to find it. It is a file you can create on the device. With the appropriate option set in the driver, the contents will be appended to all stylesheets in kepubs and epubs when they are sent to the device. Details of this are in http://www.mobileread.com/forums/sho...56#post2584056
Quote:
There are a bunch of css files, but none with that name (see: attachment).
Why do you have so many CSS files on the device? I can't think of reason for them to be there.
davidfor is offline   Reply With Quote
Old 02-29-2016, 11:34 AM   #7
Libron
Member
Libron began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Feb 2016
Device: Kindle 5, Kobo Glo HD
Quote:
Originally Posted by davidfor View Post
And I wouldn't expect you to find it. It is a file you can create on the device. With the appropriate option set in the driver, the contents will be appended to all stylesheets in kepubs and epubs when they are sent to the device. Details of this are in http://www.mobileread.com/forums/sho...56#post2584056


Why do you have so many CSS files on the device? I can't think of reason for them to be there.
I did everything as in these instructions and it doesn't work. Those css files I have come from mods I have installed, mostly from KOReader.
Libron is offline   Reply With Quote
Old 02-29-2016, 01:23 PM   #8
Libron
Member
Libron began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Feb 2016
Device: Kindle 5, Kobo Glo HD
Actually, I now see it does work, but only with images inside the text, not with the cover image. Is there a way to do it for the cover, too?
Libron is offline   Reply With Quote
Old 02-29-2016, 02:51 PM   #9
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: 44,287
Karma: 30129784
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 Libron View Post
Actually, I now see it does work, but only with images inside the text, not with the cover image. Is there a way to do it for the cover, too?
The problem you are most likely encountering is that in most cover XHTML files there is no CSS linked. So what you need to do is load your ePub into the Calibre eBook editor and see if the CSS is being linked to in the cover XHTML and if not, add it in.
JSWolf is online now   Reply With Quote
Old 02-29-2016, 03:36 PM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 19,405
Karma: 18898264
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Astak Pocket Pro, K4NT,Galaxy Tab 2
Quote:
Originally Posted by JSWolf View Post
The problem you are most likely encountering is that in most cover XHTML files there is no CSS linked. So what you need to do is load your ePub into the Calibre eBook editor and see if the CSS is being linked to in the cover XHTML and if not, add it in.
The (latest) cover is usually regenerated when sending and uses an inline CSS

But you have the right idea.

COPY and Modify the default (override) cover template and properly place it in the Users config folder
theducks is offline   Reply With Quote
Old 02-29-2016, 08:51 PM   #11
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 10,203
Karma: 15432825
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo: Touch, Glo, Aura H2O, Glo HD
Quote:
Originally Posted by Libron View Post
I did everything as in these instructions and it doesn't work. Those css files I have come from mods I have installed, mostly from KOReader.
Quote:
Originally Posted by Libron View Post
Actually, I now see it does work, but only with images inside the text, not with the cover image. Is there a way to do it for the cover, too?
I did an experiment myself last night. The CSS I found worked in a kepub, but not an epub. That's about what I expected as different renderers are used for them and the kepub renderer is more likely to support this.

And as the others have said, the cover is probably using different code. If the cover was placed by calibre (a conversion or Polish) it will be displayed using SVG rather than a simple IMG tag. The sample code I gave will only work with the latter. I am sure the something similar is possible for the image inside the SVG wrapper. But, if you are using kepubs, this will help when opening the book, but not with the covers display in the interface. For epubs, the covers are done by rendering the first page of the book. For kepubs, the covers are an image in the epub with the appropriate properties. This means the cover image in the book will need to be inverted. And that puts you back to the original question.

A possible way to do this is to send the covers separately. The Kobo drivers can send the covers to the device so that the device does not need to generate them. The cover sent is whatever is the cover in the calibre library. That still needs a way to invert the covers, but it is an alternative.

Another alternative is to not use night mode, but to invert the colours of the text using CSS. That would mean the interface would display normally, but when reading it would be in a pseudo-night mode. Getting this right would take some experimentation, but it should be possible.
davidfor is offline   Reply With Quote
Old 03-01-2016, 11:13 AM   #12
MGlitch
Fanatic
MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.MGlitch ought to be getting tired of karma fortunes by now.
 
Posts: 582
Karma: 2306344
Join Date: Aug 2014
Device: Kobo Aura H20, Nook Glowlight
I find myself in the same boat, I didn't think I'd like Night Mode, but ended up loving it.

It's tedious, but I'm using Photoshop to invert the cover.jpg that Calibre saves in its library. The tedious bit comes in with getting the images, it doesn't seem PS has a way to open all images within multiple folders without making aliases to those folders. Which might not be an issue except the images are all in calibre library/author/book title.

So while I save myself a few keystrokes by just making an action in PS to invert, save, and close, I still have to open each image.

Once I'm done with all the ebooks I have, I'll use the method David suggested of sending covers to the device. Already tested this with one book and it worked perfectly.

I've thought about getting the images out of those folders in some way, but that adds way more involved work on the backend as I'd then have to match up all the covers with the book.

I figure that if, at some point, I decide to go back to regular I can just have Calibre batch download cover art again and let it replace the inverted images.

ETA- All done now, I was done inverting the books about an hour ago, which means it took me about two hours to invert all my covers, though I wasn't exactly rushing. Not sure how long it took Calibre to upload the images for all the ebooks, I set it to go and walked my dog. When I got home it was finished.

Last edited by MGlitch; 03-01-2016 at 02:55 PM.
MGlitch is offline   Reply With Quote
Old 03-02-2016, 04:35 PM   #13
Libron
Member
Libron began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Feb 2016
Device: Kindle 5, Kobo Glo HD
Thanks for the replies.

Quote:
Originally Posted by JSWolf View Post
The problem you are most likely encountering is that in most cover XHTML files there is no CSS linked. So what you need to do is load your ePub into the Calibre eBook editor and see if the CSS is being linked to in the cover XHTML and if not, add it in.
It would be too tedious, with my huge library.

Quote:
Originally Posted by davidfor View Post
Another alternative is to not use night mode, but to invert the colours of the text using CSS. That would mean the interface would display normally, but when reading it would be in a pseudo-night mode. Getting this right would take some experimentation, but it should be possible.
I tried that and it works, but while text is inverted, top and bottom margins are not, even in full-screen, so it looks weird.

Quote:
Originally Posted by MGlitch View Post
I find myself in the same boat, I didn't think I'd like Night Mode, but ended up loving it.

It's tedious, but I'm using Photoshop to invert the cover.jpg that Calibre saves in its library. The tedious bit comes in with getting the images, it doesn't seem PS has a way to open all images within multiple folders without making aliases to those folders. Which might not be an issue except the images are all in calibre library/author/book title.

So while I save myself a few keystrokes by just making an action in PS to invert, save, and close, I still have to open each image.

Once I'm done with all the ebooks I have, I'll use the method David suggested of sending covers to the device. Already tested this with one book and it worked perfectly.

I've thought about getting the images out of those folders in some way, but that adds way more involved work on the backend as I'd then have to match up all the covers with the book.

I figure that if, at some point, I decide to go back to regular I can just have Calibre batch download cover art again and let it replace the inverted images.

ETA- All done now, I was done inverting the books about an hour ago, which means it took me about two hours to invert all my covers, though I wasn't exactly rushing. Not sure how long it took Calibre to upload the images for all the ebooks, I set it to go and walked my dog. When I got home it was finished.
Thanks, that's probably the best solution. It takes some time, but not as much as manual code editing and gets the job done. I use free GIMP, instead of Photoshop.Thankfully it also has customizable keyboard shortcuts, so I temporarily made GIMP my custom program for opening jpgs and use shortcut combo Ctrl+A (select), Ctrl+S (invert), Ctrl+D (export and overwrite), Ctrl+F (close).
Libron 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
Command line: How to embed color default cover instead of missing cover? EbokJunkie Conversion 9 07-22-2015 12:30 AM
Accessories Paperwhite Cover Color Mookie Amazon Kindle 55 09-17-2013 05:13 PM
convert PDFs to "night mode" by inverting colors? soondai PDF 7 08-06-2011 11:55 PM
Ended Nook Color plus Leather Cover Mr. Goodbar Flea Market 4 05-02-2011 03:04 PM
Inverting Book Title and Author labels Logseman Calibre 5 05-29-2010 11:23 AM


All times are GMT -4. The time now is 09:54 AM.


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