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

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 02-20-2018, 07:29 PM   #1
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,697
Karma: 5514284
Join Date: Mar 2015
Device: Kindle, iOS
SVG images - why?

I have been long confused by SVG and would like to understand.

What is the benefit of wrapping a cover jpg (or any image) in SVG code? I've seen ebooks with cover images without SVG; and other ebooks wrap the cover jpg in SVG. SVG also seems to be the default for Sigil and Calibre.

But when I load these ebooks onto my iDevices (reading with an epub app) or Kindle (after converting epub via KindleGen) both seem to work fine, and I'm not understanding the advantage of SVG.

Google has not been helpful in enlightening my poor brain, and I would really like to learn this. Thank you.
odamizu is offline   Reply With Quote
Old 02-20-2018, 07:57 PM   #2
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,752
Karma: 86500093
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
A "SVG wrapper" is sometimes applied to an image in order to scale it as large as possible on a page without distortion. This is not possible using just using HTML because screens can have widely differing aspect ratios.

This does nothing for the cover of a kindle book because Amazon uses just the underlying image and ignores the HTML or SVG coding of the cover page.

Another unrelated use of SVG is to provide images that can scale large or small without becoming pixelated. This is used for things like charts and equations, rather than photographic images.
jhowell is offline   Reply With Quote
Old 02-20-2018, 09:05 PM   #3
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: 76,433
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Speaking of Amazon and covers, Amazon really doesn't want you to see the cover of the book you are reading.
JSWolf is offline   Reply With Quote
Old 02-20-2018, 10:42 PM   #4
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,697
Karma: 5514284
Join Date: Mar 2015
Device: Kindle, iOS
Quote:
Originally Posted by jhowell View Post
A "SVG wrapper" is sometimes applied to an image in order to scale it as large as possible on a page without distortion. This is not possible using just using HTML because screens can have widely differing aspect ratios.

This does nothing for the cover of a kindle book because Amazon uses just the underlying image and ignores the HTML or SVG coding of the cover page.

Another unrelated use of SVG is to provide images that can scale large or small without becoming pixelated. This is used for things like charts and equations, rather than photographic images.
I feel like this is still going over my head

Am I understanding correctly that the general advantage of SVG is that it reduces distortion and pixelization?

But SVG makes no difference when it comes to cover images in Kindle books?

Does SVG make a difference for non-cover images in KF8?

Thank you for any enlightenment you can offer
odamizu is offline   Reply With Quote
Old 02-20-2018, 11:16 PM   #5
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,752
Karma: 86500093
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Quote:
Originally Posted by odamizu View Post
I feel like this is still going over my head
It is difficult to explain. Perhaps someone else will jump in with a better description.

Quote:
Originally Posted by odamizu View Post
Am I understanding correctly that the general advantage of SVG is that it reduces distortion and pixelization?
It can eliminate distortion in the form of stretching or cropping of raster images (such as cover photos) that do not have the same aspect ratio of the screen used to display the book. It can also eliminate pixelization of vector graphics, such as diagonal lines, so that they do not appear jagged when zoomed in. These are really two different things.

Quote:
Originally Posted by odamizu View Post
But SVG makes no difference when it comes to cover images in Kindle books?
Yes, but it does affect EPUB so when kindle books are converted to EPUB the cover HTML is often generated with an SVG wrapper so that it renders nicely.

Quote:
Originally Posted by odamizu View Post
Does SVG make a difference for non-cover images in KF8?
I believe that it can also be used for that purpose, but I do not have experience with that.

Use of SVG in anything but the cover can sometimes prevent a kindle book from supporting enhanced typesetting.

Last edited by jhowell; 02-20-2018 at 11:29 PM.
jhowell is offline   Reply With Quote
Old 02-20-2018, 11:49 PM   #6
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,697
Karma: 5514284
Join Date: Mar 2015
Device: Kindle, iOS
Quote:
Originally Posted by jhowell View Post
... It can eliminate distortion in the form of stretching or cropping of raster images (such as cover photos) that do not have the same aspect ratio of the screen used to display the book. It can also eliminate pixelization of vector graphics, such as diagonal lines, so that they do not appear jagged when zoomed in. These are really two different things.
Thank you! I think I understand now

Quote:
Use of SVG in anything but the cover can sometimes prevent a kindle book from supporting enhanced typesetting.
This means SVG in non-cover images can interfere with conversion to KFX?

Can SVG in non-cover images cause problems with KF8?
odamizu is offline   Reply With Quote
Old 02-21-2018, 12:20 PM   #7
jhowell
Grand Sorcerer
jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.jhowell ought to be getting tired of karma fortunes by now.
 
jhowell's Avatar
 
Posts: 6,752
Karma: 86500093
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
Quote:
Originally Posted by odamizu View Post
This means SVG in non-cover images can interfere with conversion to KFX?

Can SVG in non-cover images cause problems with KF8?
See the Amazon Kindle Publishing Guidelines for information on SVG support in KF8:

Quote:
9.4.12 Use Supported SVG Tags and Elements

A publisher can reference the SVG files from within an HTML file using inline <svg>, <img>, <embed>, or <object> tags. Refer to the SVG specification http://www.w3.org/TR/SVG/ for details about SVG. SVG with animation is not supported. SVGs are not supported in iOS. Enhanced Typesetting does not support SVG images.
...
in most cases use of SVG (other than for a cover image) blocks KFX conversion. I haven't tested this extensively, but it appears that if a boilerplate SVG wrapper is used in other places the book will sometimes convert to KFX, despite what the guidelines say.
jhowell is offline   Reply With Quote
Old 02-21-2018, 01:20 PM   #8
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
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:
Originally Posted by jhowell View Post
See the Amazon Kindle Publishing Guidelines for information on SVG support in KF8:



in most cases use of SVG (other than for a cover image) blocks KFX conversion. I haven't tested this extensively, but it appears that if a boilerplate SVG wrapper is used in other places the book will sometimes convert to KFX, despite what the guidelines say.
I would interpret the advance typesetting to say that is would not work on text in an SVG image which is likely true.

Dale
DaleDe is offline   Reply With Quote
Old 02-21-2018, 05:04 PM   #9
j.p.s
Grand Sorcerer
j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.j.p.s ought to be getting tired of karma fortunes by now.
 
Posts: 5,528
Karma: 100606001
Join Date: Apr 2011
Device: pb360
Quote:
Originally Posted by odamizu View Post
Can SVG in non-cover images cause problems with KF8?
I don't know whether SVG images can cause problems with KF8, but I do know that SVG images that are actually made with vectors instead of pixels can look great in KF8 books.

In the thread https://www.mobileread.com/forums/sh...d.php?t=288215, post #27 has an epub book with SVG images attached, and post #34 has the same book converted to KF8. You can extract the images from either and view them in a web browser and see how they keep looking better the more you zoom.

Post #1 in that thread has the original epub with PNG images and you can see how those start looking bad fast with zooming. The epub in post #1 with SVG images has no use except as an example of how not to put SVG images in an epub.
j.p.s is offline   Reply With Quote
Old 02-21-2018, 06:51 PM   #10
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,697
Karma: 5514284
Join Date: Mar 2015
Device: Kindle, iOS
Thanks all! I think SVG may be more than my simple brain can handle.

What prompted my question is that I was poking around the Sigil forums when I came across the nifty plugin “InsertImageSVG” (plugin to insert and wrap an image with SVG). I then thought, “gee, maybe I should start wrapping all my images in SVG code!”

But while that seems to have benefits for ePub, it looks like it may have disadvantages for ePubs that will be converted to KF8??? (And it definitely has potential for interfering with conversion to KFX, which is not a real concern for me since I’m a KF8 gal, but still worth noting.)

So maybe I shouldn’t go crazy with the SVG plug-in?

(Note also that I’m just talking about wrapping jpg and png in SVG code, not in using SVG images, which is definitely more than my simple brain can handle )

Last edited by odamizu; 02-21-2018 at 06:55 PM.
odamizu is offline   Reply With Quote
Old 02-23-2018, 12:04 AM   #11
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,304
Karma: 12587727
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by odamizu View Post
What is the benefit of wrapping a cover jpg (or any image) in SVG code? I've seen ebooks with cover images without SVG; and other ebooks wrap the cover jpg in SVG. SVG also seems to be the default for Sigil and Calibre.
As others have mentioned, the SVG Wrapper allows the underlying image to stretch/expand without distortion.

This differences really stand out when you have Tall/Skinny or Fat/Short images, OR you turn your device from Portrait->Landscape.

For example:

Example 1 (SVG Wrapper vs. HTML Width) [Portrait]

You can see the SVG Wrapper stays the proper ratio:

Click image for larger version

Name:	Example1-SVGWrapper[Portrait].jpg
Views:	420
Size:	104.2 KB
ID:	162466

but the HTML version that stretches to "100% width/height of the screen" starts turning into an oompa loompa:

Click image for larger version

Name:	Example1-HTMLWidth[Portrait].jpg
Views:	423
Size:	122.0 KB
ID:	162467

Example 2 (SVG Wrapper vs. HTML Width) [Landscape]

The problem becomes much worse when you turn the device to landscape.

You can see the SVG Wrapper keeps the ratio correct:

Click image for larger version

Name:	Example2-SVGWrapper[Landscape].jpg
Views:	369
Size:	44.4 KB
ID:	162468

but the HTML Width+Height version gets severely distorted:

Click image for larger version

Name:	Example2-HTMLWidthHeight[Landscape].jpg
Views:	384
Size:	77.2 KB
ID:	162469

while the HTML Width version gets chopped off and flies off the screen:

Click image for larger version

Name:	Example2-HTMLWidth[Landscape].jpg
Views:	389
Size:	56.8 KB
ID:	162470

Quote:
Originally Posted by j.p.s View Post
I don't know whether SVG images can cause problems with KF8, but I do know that SVG images that are actually made with vectors instead of pixels can look great in KF8 books.
But sadly, SVGs don't work in old MOBI. So you would have to create fallback images anyway. A real giant pain.

I still recommend having the SVG sources though, so in the future you could generate higher quality/resolution images (like in my Formulas to PNG tutorial).

Though an absolutely fantastic post you referenced if I do say so myself.

Last edited by Tex2002ans; 02-23-2018 at 12:13 AM.
Tex2002ans is offline   Reply With Quote
Old 02-23-2018, 02:35 AM   #12
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,697
Karma: 5514284
Join Date: Mar 2015
Device: Kindle, iOS
@Tex2002ans: Thank you so much for these examples! As they say, a picture paints a thousand words
odamizu is offline   Reply With Quote
Old 02-24-2018, 03:51 PM   #13
odamizu
just an egg
odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.odamizu ought to be getting tired of karma fortunes by now.
 
odamizu's Avatar
 
Posts: 1,697
Karma: 5514284
Join Date: Mar 2015
Device: Kindle, iOS
I ran a few quick tests and see, indeed, how images in EPUBs benefit from an SVG wrapper.

KF8 seems to handle SVG wrappers okay, too (in my limited, quick testing).

However, when the Kindle Publishing Guidelines say "SVGs not supported in iOS," they aren't kidding! Kindle for iOS will totally ignore images wrapped in SVG code, i.e., the image will be missing and the page will be blank!

So it seems if an ebook will at any point be read on Kindle for iOS, images (or at least non-cover images) should not be wrapped in SVG code.

So much for my brief foray into SVG. But it was worth it to better understand SVG, and for that I once again thank you all!
odamizu is offline   Reply With Quote
Old 02-28-2018, 06:07 PM   #14
graycyn
Wizard
graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.graycyn ought to be getting tired of karma fortunes by now.
 
Posts: 1,571
Karma: 11380098
Join Date: Aug 2010
Location: NE Oregon
Device: Kobo Sage, Pocketbook Era, Kobo Forma, Kindle Oasis 2
SVG images - why?

Quote:
Originally Posted by odamizu View Post
However, when the Kindle Publishing Guidelines say "SVGs not supported in iOS," they aren't kidding! Kindle for iOS will totally ignore images wrapped in SVG code, i.e., the image will be missing and the page will be blank!


True, but there's a workaround so the page won't be blank. If you use title tags within your SVG, the text within *will* show up on Kindle for iOS.

I know this because I like to do my title page text/images as SVG, but I make a habit of always using title tags to list title and author, as apps that don't support SVG usually will render the text, thus avoiding the blank page look.

Less useful though in instances where you NEED the image content to be seen.

I wonder WHY Kindle for iOS doesn't support SVG though, seems crazy when Kindle for Android has no issues. Does Apple not allow Amazon to support SVG or has Amazon just been lazy with the iOS app?


Sent from my iPad using Tapatalk

Last edited by graycyn; 02-28-2018 at 06:15 PM.
graycyn is offline   Reply With Quote
Old 03-01-2018, 01:42 AM   #15
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,304
Karma: 12587727
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by graycyn View Post
True, but there's a workaround so the page won't be blank. If you use title tags within your SVG, the text within *will* show up on Kindle for iOS.

I know this because I like to do my title page text/images as SVG, but I make a habit of always using title tags to list title and author, as apps that don't support SVG usually will render the text, thus avoiding the blank page look.
Do you have any example EPUBs of this?
Tex2002ans 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
Scaling images with SVG wrapper Pablo ePub 4 07-07-2015 02:44 PM
SVG images not going into the e-book bkleine Conversion 1 11-23-2014 10:01 PM
Touch SVG Images Often Appear as Black Rectangles MikeWV Kobo Reader 3 07-09-2014 02:13 PM
blank pages after SVG images in Kobo jobalcaen ePub 3 05-19-2013 02:19 PM
can I use SVG images in mobi? sarah_pnix Kindle Formats 4 01-07-2013 05:21 PM


All times are GMT -4. The time now is 07:51 PM.


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