Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 08-28-2023, 06:55 AM   #1
Jake Stoddard
Member
Jake Stoddard began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Aug 2023
Location: New Hampshire
Device: none
Dealing with no transparency

I have a PNG where a corner of it is transparent. (It's a picture of a newspaper where the article text is removed, but the headline and photo remain, creating an L-shaped opaque area and a rectangular transparent area.)

I copied the epub to Kindle, and it shows a block of white where it should be transparent. I've concluded that Kindle doesn't support transparency, even though they started supporting epubs.

I'm wondering if I can work around the issue by having multiple images where the transparent area is either white, sepia, green, or black and choose which to display based on the background color the user has chosen for their Reader.

If the background color is white (or close to it), display the white version. If the background color is sepia (or close to it), display the sepia version. Etc.

Is that possible? How would I do that?

Or would Kindle actually display the transparency correctly if I set up my epub (v3) differently?

Note: Another use case is for scene break images—irregular shapes that get set in a white rectangle instead of a transparent background.
Jake Stoddard is offline   Reply With Quote
Old 08-28-2023, 08:53 AM   #2
Quoth
the rook, bossing Never.
Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.Quoth ought to be getting tired of karma fortunes by now.
 
Quoth's Avatar
 
Posts: 11,166
Karma: 85874891
Join Date: Jun 2017
Location: Ireland
Device: All 4 Kinds: epub eink, Kindle, android eink, NxtPaper11
Transparency isn't possible on most ereaders.
Also epubs of any kind don't work on Kindle. Either you or Amazon have to convert them.
Quoth is offline   Reply With Quote
Advert
Old 08-28-2023, 09:42 AM   #3
Jake Stoddard
Member
Jake Stoddard began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Aug 2023
Location: New Hampshire
Device: none
Quote:
Transparency isn't possible on most ereaders.
Bummer.

Do you think there's a way to work around it with my idea of multiple images and selecting on based on the eReader's background color?

Quote:
Also epubs of any kind don't work on Kindle. Either you or Amazon have to convert them.
Amazon must be doing it then. I'm using https://www.amazon.com/sendtokindle and it won't even take mobi files. From what I read, Amazon finally abandoned mobi for epub recently. But maybe they still use mobi under the hood.
Jake Stoddard is offline   Reply With Quote
Old 08-28-2023, 10:29 AM   #4
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Quote:
Originally Posted by Quoth View Post
Transparency isn't possible on most ereaders.
Also epubs of any kind don't work on Kindle. Either you or Amazon have to convert them.
That might be true for dedicated readers like paperwhite or other eink, but app based readers shouldn’t have a problem handling transparency channels on their images. Kindle for desktop, phone, iPad, etc. technologically shouldn’t have a problem with it. Amazon has simply created a “one-size-fits-all” importer/converter so they don’t have to think too hard…

From Kindle Guidelines:
Code:
4. Supported input formats: Kindle devices and reading applications do 
not support TIFF, multi-frame GIFs, or images with transparent areas. 
When images are provided with transparent backgrounds, we convert 
the transparent background to white.
Making different colored backgrounds would be possible if there was a media querie that provided the background color. I’m not smart enough on MQs to know if there is???

However, I think that may be over thinking things a bit… not to mention exploding the file size of your ePub. Just let Amazon convert it into a white background. If anyone complains point them at Amazon. Customer complaints is the only way to get Amazon to do/fix anything.

Last edited by Turtle91; 08-28-2023 at 10:34 AM.
Turtle91 is offline   Reply With Quote
Old 08-28-2023, 11:22 AM   #5
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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
I do have an idea for something to try. Convert the ePub to KF8 using calibre. Then load the Kf8 in the editor and load the original image over the one in the KF8 and give it a try on your Kindle. You've nothing to lose by trying.
JSWolf is offline   Reply With Quote
Advert
Old 08-28-2023, 12:40 PM   #6
Jake Stoddard
Member
Jake Stoddard began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Aug 2023
Location: New Hampshire
Device: none
I'm willing to try that. However, I don't see KF8 as an option in Calibre's conversion window.
Attached Thumbnails
Click image for larger version

Name:	calibre-output-formats.png
Views:	41
Size:	4.5 KB
ID:	203410  
Jake Stoddard is offline   Reply With Quote
Old 08-28-2023, 12:59 PM   #7
Jake Stoddard
Member
Jake Stoddard began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Aug 2023
Location: New Hampshire
Device: none
I'm also not sure what I would do with a KF8 file. SendToKindle doesn't include it in it's supported file types:

Supported File Types: PDF, DOC, DOCX, TXT, RTF, HTM, HTML, PNG, GIF, JPG, JPEG, BMP, EPUB
Jake Stoddard is offline   Reply With Quote
Old 08-28-2023, 01:51 PM   #8
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,095
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
Try azw3
Turtle91 is offline   Reply With Quote
Old 08-28-2023, 02:01 PM   #9
Jake Stoddard
Member
Jake Stoddard began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Aug 2023
Location: New Hampshire
Device: none
Please forgive my noobiness. Some googling showed me that KF8 == AZW3.

I converted the file to AZW3 and tried to replace the file, but the "Replace" option in Calibre is missing. (See screenshot.)
Attached Thumbnails
Click image for larger version

Name:	calibre-replace-image-option-missing-when-editing-azw3.png
Views:	40
Size:	35.6 KB
ID:	203411  
Jake Stoddard is offline   Reply With Quote
Old 08-28-2023, 02:28 PM   #10
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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Jake Stoddard View Post
I'm willing to try that. However, I don't see KF8 as an option in Calibre's conversion window.
KF8 is the official name for AZW3.
JSWolf is offline   Reply With Quote
Old 08-28-2023, 02:29 PM   #11
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: 74,015
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by Jake Stoddard View Post
I'm also not sure what I would do with a KF8 file. SendToKindle doesn't include it in it's supported file types:

Supported File Types: PDF, DOC, DOCX, TXT, RTF, HTM, HTML, PNG, GIF, JPG, JPEG, BMP, EPUB
You wouldn't send to Kindle. You would have to side-load via USB in order to do the testing. And if it works, you still cannot send-to-Kindle.
JSWolf is offline   Reply With Quote
Old 08-28-2023, 03:08 PM   #12
DNSB
Bibliophagist
DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.DNSB ought to be getting tired of karma fortunes by now.
 
DNSB's Avatar
 
Posts: 35,464
Karma: 145525534
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Forma, Clara HD, Lenovo M8 FHD, Paperwhite 4, Tolino epos
Quote:
Originally Posted by Jake Stoddard View Post
Amazon must be doing it then. I'm using https://www.amazon.com/sendtokindle and it won't even take mobi files. From what I read, Amazon finally abandoned mobi for epub recently. But maybe they still use mobi under the hood.
The ebooks sent to you by Amazon will be KFX, KF8/azw3 or mobi. What you are looking at in Send to Kindle are the input formats Amazon will accept not the output formats. Which Amazon format you receive will depend on your reading device/application. Antique Kindle eInk devices will get mobi since they do not support KF8 or KFX.
DNSB is offline   Reply With Quote
Old 08-29-2023, 07:29 AM   #13
Jake Stoddard
Member
Jake Stoddard began at the beginning.
 
Posts: 13
Karma: 10
Join Date: Aug 2023
Location: New Hampshire
Device: none
Thanks for bearing with me.

Although the "Replace" option was missing when editing the AZW3 file, I was able to replace the image when editing the epub. Then I converted the epub to the AZW3 file, and saw in Calibre that the transparency was working.

I converted it back to an epub and uploaded that to my Kindle app using SendToKindle. Unfortunately, the app showed that image with opaque white where there should have been transparency.

That fits with what Turtle91 quoted from the Kindle Guidelines.


Quote:
Originally Posted by JSWolf View Post
You wouldn't send to Kindle. You would have to side-load via USB in order to do the testing. And if it works, you still cannot send-to-Kindle.
Ah, too bad. Yeah, I'm using a Kindle app, not an actual Kindle. I thought Send to Kindle was side-loading because it's not downloading through the store.

As it happens, I'm testing this to give out to a couple hundred people, and they're not all going to side-load via USB to get the book. So, that's not really an option.

Thanks for the idea, anyway.


Quote:
Originally Posted by Turtle91 View Post
Making different colored backgrounds would be possible if there was a media querie that provided the background color.

However, I think that may be over thinking things a bit…
I don't mind overthinking a little, particularly when I'm learning.

I read in another thread that some eReaders don't support media queries. They treat every MQ as matching, so all the code in each MQ would be applied. In this case, every variant of the image would be displayed.

Maybe javascript would work in place of media queries?
Jake Stoddard is offline   Reply With Quote
Old 08-31-2023, 01:35 AM   #14
azimuth
Enthusiast
azimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with othersazimuth plays well with others
 
Posts: 33
Karma: 2538
Join Date: Aug 2023
Location: NW US
Device: none
Perhaps something similar could be done for your goal, as was utilized at this MobileRead link where they had an upside down L-shaped image and the text wrapped around it all nicely:
Another MR article
azimuth is offline   Reply With Quote
Old 09-14-2023, 01:18 AM   #15
AlanHK
Guru
AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.AlanHK ought to be getting tired of karma fortunes by now.
 
AlanHK's Avatar
 
Posts: 668
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
If your target is Kindle, PNGs aren't preserved when converted to a Kindle format. At least, not MOBI/KF7 or AZW/KF8. Don't know about KFX.

I unpacked the kindle formats made by Kindlegen and all PNGs had been converted to either GIF or JPG.
And no transparency, even in the GIF format which does support it.

So if I have a PNG, or an image that is basically linework, diagrams, text, or cartoonish art, I usually convert it to GIF myself so I can optimise it. Kindlegen passes GIFs through to the Kindle format unchanged (so far). I use Irfanview (Windows) for this, which can do stuff like resize, sharpen, change colour depth, edit the palette. And also convert transparency to white.
AlanHK is offline   Reply With Quote
Reply

Tags
background color, epub, image, kindle, transparency


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dealing with updates Renate Onyx Boox 3 11-17-2022 10:18 AM
About transparency Land_Outcast ePub 11 05-31-2020 01:53 PM
Transparency DrewBoyd Kindle Formats 8 05-24-2016 07:33 AM
Dealing with Covers Paula-59 Workshop 9 03-15-2016 07:57 PM


All times are GMT -4. The time now is 04:08 PM.


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