I have a batch of SVG files with embedded, high-res PNG images. The PNG files have been resized considerably smaller (via transform
, matrix
, etc). What is the best way to resample these embedded images in place? The goal is to get smaller, faster-loading SVG files.
Just to clarify some terminology (emphasis added):
Resampling changes the total number of pixels in the image…
…
When you resize an image and do not resample it, you change the size of the image without changing the amount of data…
Clearly, I am only resizing the images right now.
I have toyed with trying to automate it using ImageMagick, but keeping the image proportions is not entirely trivial. Is there a simple Inkscape hack? Or something else I'm overlooking?
Best Answer
Inkscape does in fact have a resample option (it may be part of ImageMagick). These options are available from the
Extensions -> Raster
menu.To resample items in your image:
Extensions -> Images -> Embed Images...
Extensions -> Raster -> Resample
Width
andHeight
values to the lowest acceptable valuesApply
andClose
This method will work well during the authoring process. I am still working on a way to automate this and will update this post if I find a good method.