Mobileread
About transparency
#1  Land_Outcast 05-27-2020, 06:26 PM
Hey there, until now I would have used PNG for icons with transparent backgrounds (with all those fancy color schemes, a white background looks awful).
But now I see a really poor rendering of PNGs on ADE, so I thought to use SVGs (but they aren't allowed by Amazon's lastest format).
Ang GIFs really look awful, especially in curves.
Does anyone have a suggestion on what to do about it?
Reply 

#2  Tex2002ans 05-27-2020, 10:08 PM
What sorts of images are you working with? I assume these are purely vector drawings since you mentioned SVG as well.

And are you trying to have this as little symbols inline scaling with text? Or are they completely separate large graphics?

Back in 2013, inline SVGs were written about in "Apple symbol and other special characters in ePub".

Quote Land_Outcast
But now I see a really poor rendering of PNGs on ADE,
What's the rendering issues you're getting on ADE? I know their image scaling algorithm is garbage, but that's across the board.

In Amazon's ecosystem, transparent PNGs aren't well supported. Last I recall, they're automatically converted into JPGs. (And back in 2013, KindleGen had other transparent PNG issues.)

Quote Land_Outcast
so I thought to use SVGs (but they aren't allowed by Amazon's lastest format).
It also sounds like you want to have "one file to rule them all", but for this particular problem, you can't.

Similar to equations, there are ways to finagle SVG (with PNG fallback) into the ebook with a lot of elbow grease... but it's usually not worth it. And that comes with its own quirks/bugs (potential duplicate images).

Usually, you just go with the easiest + lowest common denominator, and make sure it works across a wide swathe of devices instead.

If you want to put in the extra work, you'd most likely have to create completely separate books:

- one for EPUB with SVGs and/or transparent PNGs
- one for MOBI with non-transparent bitmap images

Quote Land_Outcast
Does anyone have a suggestion on what to do about it?
And is this for personal use? Or are you trying to sell this ebook?

If you're designing this for something like the MR Library, then no problems. Go with SVG and/or Transparent PNGs in your EPUB. I believe Calibre even converts transparent PNGs to Kindle formats fine.

If going for sale though.... probably strongly recommend against it.
Reply 

#3  Land_Outcast 05-27-2020, 10:37 PM
Thanks for the detailed response, Tex.

These are books which are being digitalized for sale through the major distributors.

I mentioned SVG because some of the books have simple, or not so simple, vector graphics. Most of those which present this issue, though, have bitmap images with transparencies, not vectors.
Quote
It also sounds like you want to have "one file to rule them all", but for this particular problem, you can't.
Yes, I'm well aware. And I'd love one format to rule them all, but I know most of the time that is being naïve, heh.

Quote
Usually, you just go with the easiest + lowest common denominator, and make sure it works across a wide swathe of devices instead.
For the time being I've been using GIFs, the result is not hideous, but it is the lowest common denominator, with the usual drawbacks that implies. By the way, I belive they do work ok in most formats, but I'm something of a newcomer in this, so please correct me if I'm wrong in my belief.

I could, realistically, call it a day and just leave it at centered jpg images with white background, no float, no transpanecy… but I like to do things the best they can be done with my current skills (or learn a thing o two and do them better), and the allotment of time for the task in question.

Quote
Similar to equations, there are ways to finagle SVG (with PNG fallback) into the ebook with a lot of elbow grease... but it's usually not worth it. And that comes with its own quirks/bugs (potential duplicate images).
I thought about using queries (to use a PNG when adequately rendered, otherwise use a GIF), but it would imply a lot of work, and I don't know how well supported they (queries) are across the board.
Reply 

#4  Tex2002ans 05-28-2020, 03:33 PM
Quote Land_Outcast
These are books which are being digitalized for sale through the major distributors.
Then you'll have to be a bit more strict, and lean much more towards safe/"no bugs".

(If there are bugs, there are complaints and books get returned/pulled. And on Amazon, if you get the dreaded KQN [Kindle Quality Notice], sales drop dramatically.)

Quote Land_Outcast
I mentioned SVG because some of the books have simple, or not so simple, vector graphics. Most of those which present this issue, though, have bitmap images with transparencies, not vectors.
Can you show some screenshot examples of the problem-as-you-see-it in ADE?

(And if it's just scaling, just know that ADE's image scaling sucks, but from what I've seen on actual devices [Kobo, Nook, etc.], the scaling is better.)

Quote Land_Outcast
I thought about using queries (to use a PNG when adequately rendered, otherwise use a GIF), but it would imply a lot of work, and I don't know how well supported they (queries) are across the board.
If you want an ebook that works across the board:

PNG with white background (no Alpha/transparency).

For actual "EPUB-only" EPUBs, I think you'd be fine using transparent PNGs, and finagling a little more with some SVGs.

For "EPUB->Kindle" EPUBs, you might want to then use KF8/MOBI Media Queries (found in the Kindle Publishing Guidelines, Appendix D).

The issue with media queries outside of that... they could potentially lead to the "duplicate image" bug. For example, there are a ton of non-standards compliant readers out there (like Moon+ Reader on Android, etc.). So they'll ignore the query, then you'll see BOTH images.

[QUOTE=Land_Outcast;3993490]For the time being I've been using GIFs, the result is not hideous, but it is the lowest common denominator, with the usual drawbacks that implies. By the way, I belive they do work ok in most formats, but I'm something of a newcomer in this, so please correct me if I'm wrong in my belief.

GIF is an antiquated format that needs to be stuck in the dustbin. :P

PNG supersedes GIF in every way (besides animation, but animated GIFs aren't supported in ebooks).

Quote Land_Outcast
I could, realistically, call it a day and just leave it at centered jpg images with white background, no float, no transpanecy… but I like to do things the best they can be done with my current skills (or learn a thing o two and do them better), and the allotment of time for the task in question.
If you show some examples of what you're trying to accomplish, there could be different ways of tackling the issue.
Reply 

#5  Land_Outcast 05-28-2020, 05:52 PM
Quote
Can you show some screenshot examples of the problem-as-you-see-it in ADE?
Scaling is the least of problems, actually. Yes, it looks like shit but that runs for every image format. So, meh.

And for some reason I can't replicate the issue now, but it was showing weird behaviour (stretching the images vertically, turning the alpha into a zebra pattern or into a sort of grey transparency).
Quote
GIF is an antiquated format that needs to be stuck in the dustbin. :P

PNG supersedes GIF in every way (besides animation, but animated GIFs aren't supported in ebooks).
Yes, I know, but an axe is an axe, gets the job done. Might be ugly and prehistoric, but it works.
Of course I'd rather use the PNG, but I was (am) worried about file support (I'll try to replicate the weird behaviour and share it here).

I'm attaching some samples of where I need to use transparencies.
FCB_crest.png Portadilla_lacalle.png bordes.gif icono_cap_09.gif icono cap 01.gif 
Reply 

#6  RbnJrg 05-28-2020, 08:00 PM
Quote Land_Outcast
But now I see a really poor rendering of PNGs on ADE, so I thought to use SVGs (but they aren't allowed by Amazon's lastest format).
Yes and no. Amazon has seriuous issues with SVG images but some kind of svgs can be displayed with the last version of Kindle Previewer (it seems that Amazon is working on those problems with that kind of image). The .kf8 format can handle any kind of svg, but .KFX only can handle svg made of pure paths. Watch for example the following screenshot:

show attachment »

However your issues will continue because .KFX doesn't accept transparent svgs (because Amazon cheats; the original svg is converted in .jpg).

show attachment »

Below you can check the respective epub with the respective svg image used by me.

Regards
Rubén
[epub] Crest.epub (4.5 KB, 20 views)
Reply 

#7  Land_Outcast 05-30-2020, 01:58 AM
Thanks, Rubén.
Reply 

#8  Tex2002ans 05-30-2020, 02:43 PM
Quote Land_Outcast
And for some reason I can't replicate the issue now, but it was showing weird behaviour (stretching the images vertically, turning the alpha into a zebra pattern or into a sort of grey transparency).
"Zebra pattern"? Like this?

https://www.mobileread.com/forums/at...7&d=1381013845
https://www.mobileread.com/forums/at...8&d=1381013878

That's my images from a topic in 2013:

"Sony Reader for PC -- not rendering 16-color png"

Are you saving your PNGs in a strange way?

Are you saving as Indexed? (Or the very obscure: "Indexed with Alpha"?)

What image editor are you using?

Quote Land_Outcast
Yes, I know, but an axe is an axe, gets the job done. Might be ugly and prehistoric, but it works.
GIF images are 256 colors max.

"Indexed PNGs" cover that entire use-case (256 colors).

Normal PNGs (Color + Color/Alpha) then take on the entire RGB color range.

On top of that, PNGs compress so much better, because it uses more modern algorithms.

Quote Land_Outcast
Of course I'd rather use the PNG, but I was (am) worried about file support (I'll try to replicate the weird behaviour and share it here).
There's no compatibility issues I know of besides the PNG->JPG conversion that sometimes happens through KindleGen.

Only has potential to get strange when you start going into the edge cases (like 4-bit Indexed PNG).

Note: Another thing you have to look out for is that lots of image editors sometimes embed tons of crap/metadata inside PNGs too. But that can easily be stripped.

Quote Land_Outcast
I'm attaching some samples of where I need to use transparencies.
If all else fails, just PNGs with white background (no Alpha).

Not ideal, yes. Potentially hideous on color backgrounds? Yes. Fully compatible? Yes! :P

And then you just save the transparent source for some future date (or a MobileRead-specific version where you don't have to care about sales).
Reply 

#9  JSWolf 05-30-2020, 05:31 PM
if you are doing this for n eBook to sell at Amazon, you have to deal with Mobi and what you want to do won't work with Mobi.
Reply 

#10  Tex2002ans 05-30-2020, 08:06 PM
Quote JSWolf
if you are doing this for n eBook to sell at Amazon, you have to deal with Mobi and what you want to do won't work with Mobi.
This was already covered in Post #4.
Reply 

  Next »  Last »  (1/2)
Today's Posts | Search this Thread | Login | Register