Feature Request: support embedding of webp images in svg output (instead of png conversion)

Summary:

Inkscape current imports webp images, which is useful comparability, but converts them to png on import. webp's format features are superset of jpeg, png, and gif and it has excellent coding efficiency. In tests I found replacing png encoded data with webp data was fully compatible and yields a very meaningful reduction in file size at equivalent quality.

https://gessel.blackrosetech.com/2020/09/01/webp-and-svg

another, very similar solution was found to be effective at https://stackoverflow.com/questions/39291834/using-webp-as-a-background-image-in-svg/76757011#76757011

Steps to reproduce:

  • open Inkscape
  • create image that includes placed graphic, for example a placed .webp image file
  • save, note that the file size is much larger than the original graphic
  • open the .svg file in a text editor and find that the image data prefix is xlink:href="data:image/png;base64,...
  • base 64 code the original webp file that was imported creating a base64 coded webp file
  • modify the xlink to read xlink:href="data:image/webp;base64,...
  • replace the base64 coded png data that follows up to the CR before the closing " with the b64 coded webp data
  • enjoy a smaller file size with good compatibility.

What happened?

png data inserted into the .svg file instead of webp data

What should have happened?

Probably exactly that to be standards compliant, but webp data works and is quite compact. I expect AVIF data will work too and be, in many cases, even more compact.

Sample attachments:

Version info

Inkscape 1.2.2 (1:1.2.2+202305151914+b0a8486541)

GLib version:     2.72.4
GTK version:      3.24.33
glibmm version:   2.66.2
gtkmm version:    3.24.5
libxml2 version:  2.9.13
libxslt version:  1.1.34
Cairo version:    1.16.0
Pango version:    1.50.6
HarfBuzz version: 6.0.0

OS version:       Linux Mint 21
Edited by David Gessel
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information