Export PDF: Improve size of masked objects
Migrated from https://bugs.launchpad.net/inkscape/+bug/799498
Summary:
A couple masks don't have much of an impact; however the example file for OP had 600+ of them, which greatly increased the file size (from 110KB to 6+MB) during a PDF roundtrip.
I'm not sure that this issue should be fixed by Inkscape, but I'll let someone else make the call, rather than quietly closing it on launchpad.
Steps to reproduce:
- Open Inkscape
- Open zmena_orig.svg (minimised version of original file from launchpad)
- Export to pdf
Other example files attached below.
What happened?
- Large pdf is created (6008KB) for these 626 images (most or all have image masks)
- Size is pretty linear,
- 1 image → 12KB zmena_just_one.svg
- 40 images → 480KB zmena_just_forty.svg
- Size is pretty linear,
- Warning like
** (org.inkscape.Inkscape:64964): WARNING **: 21:05:29.021: unsupported target 0
for each mask- Probably not relevant, but doesn't occur in clips and I thought to mention it.
Related issue: https://bugs.launchpad.net/inkscape/+bug/1289471 (bad performance exporting masks), which I did experience here. That is one reason why the example files have differing numbers of objects (to avoid getting SIGKILLED, the I kept shrinking the files).
What should have happened?
- Better size if possible. No warning.
Sample attachments, basically shows that the issue here is the mask, not the image or the transform, or clips:
- From steps to reproduce: zmena_orig.svg 6008 KB pdf, 9.6 KB per object
- Single object from above (mentioned in what happened): zmena_just_one.svg 12 KB for the file.
- Images replaced with a single path masked by a single path, and 200 clones of the path. zmena_201.svg 1868 KB pdf, which is 9.3 KB per object
- Same as above but transform removed. zmena_201_no_transform.svg 1852 KB pdf, 9.2 KB per object
- Same as above but scaled up by factor of 100 zmena_101_enlarged.svg 1052 KB pdf, 10.6 KB per object
- Mask v clip, similar files: zmena_101_masks.svg (748 KB) and zmena_101_clips.svg (44 KB)
Version Info:
- Inkscape 1.1-dev (57575ffd59, 2020-08-26) Linux Mint 20
- Inkscape 0.48.1-4.fc15.x86_64 on Fedora 15
- Inkscape 1.0alpha (4855a8a2) OS not mentioned.