: How to save real image size after resizing in Inskape? I have imported several photos in an Inkscape file and then reduced them manually inside my document. In order to get a lighter Inkscape
I have imported several photos in an Inkscape file and then reduced them manually inside my document. In order to get a lighter Inkscape document size, is there a way to save the document by taking into account the reduced images sizes? Or do I have to reduce my images before importing them into Inkscape?
I remember such a function in Microsoft Office Word, where it was possible to save only the real size of images clipped inside the Word document.
I hope this is clear enough... Many thanks for help and advices in advance.
More posts by @Carla748
2 Comments
Sorted by latest first Latest Oldest Best
Inkscape can export scaled bitmaps. Besides resizing, the resulting graphics can take into account added enhancements such as clipping, masking, gradients, and filter effects. If density and dimension are final, the original graphics and part of their elaboration can be replaced with the corresponding exported bitmaps. That makes it possible to continue working on a document using less memory and less processing power.
Each image has to be arranged manually at least once. Create an invisible rectangle around a raster object and export the visible area to a file. At 90 dpi, each rectangle's bitmap size matches its export area size in pixels. The exported file can then be reimported. Repetitions can be made easier. For example, you can put all invisible rectangles in a layer named "exports" and hit Ctrl-A to select them, then Check "Batch export N selected objects". The corresponding visible objects can stay in a different layer. Yet another layer can contain links to the exported bitmaps. Batch export silently overwrites files, so they are automatically updated if you keep reimported image externally linked (rather than embedded). That way you can work on a single document by switching layers visibility and lock status.
Instead, if the intent is just to obtain a reasonably sized, shareable document, it is much easier to save a copy as PDF and optimize it using an external tool, e.g. Ghostscript.
You need to modify the image with an external editor and re-embed it.
When you embed a raster image in Inkscape, it embeds it in the href of the image using a data URI:
<svg:image xlink:href="data:image/jpeg;base64,[...]"/>
When you resize an embedded image in Inkscape, what it does it is changes the height and width attributes of the <svg:image>; it does not change the data URI, meaning the image itself is not changed. You can see this yourself by looking at the XML view in Inkscape and comparing the data URI before and after resizing the image. In most cases, this is desirable behavior, since Inkscape is not really the right tool for modifying raster graphics (always use the right tool!).
To extract the embedded image, select it and use Extensions > Images > Extract Image. If you need to extract multiple images from an SVG file, you might want to look at this answer as well.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.