Am Samstag, 18. Februar 2017, 11:47:08 CET schrieb Tobias Ellinghaus:
Am Samstag, 18. Februar 2017, 14:44:57 CET schrieb Mark Schafer:
One of my most used paint programs (Ulead Photoimpact - now Corel) has an excellent exporter that calculates the file size as you change settings for jpg, png, gif. Its super useful when I am exporting to attach to an email or when I need to know the data transfer overhead for a webpage (say).
It looks like this (in part):
http://i65.tinypic.com/2zqszkj.jpg
This suggests that its not impossible to calculate the size before saving. Of course this tool is way over the top for what is being suggested. A simple slider for jpg quality would suffice.
That seems to be a raster editor. For those creating the PNG/JPEG/... on the fly is cheap. However, Inkscape has to do a lot of calculations to do in the background to create such a raster file which makes it really slow. At least that's my impression, I didn't actually measure the timings. Maybe I should do that so we know what we are talking about ...
So, exporting a relatively simple SVG which is typical for me (only lines and rectangles and circles, no filters, blurs or anything, basically a CAD drawing) takes about 25 seconds when creating a 150 PPI PNG of size 25854 x 14871. 6.3 seconds are spent in sp_export_get_rows() – those would be required for in-memory files, too. 18.3 seconds are spent in png_write_rows() – i don't know if that is needed when creating an in-memory file.
Exporting the very same file with the same settings to /tmp/ which is a tmpfs for me takes the same time, so disk access doesn't seem to matter.
For comparison, the same file exported with 25 PPI (4308 x 2478): 0.9 seconds in total, of which 0.3 are spent in sp_export_get_rows() and 0.5 in png_write_rows().
So in the end it heavily depends on the size of images you typically export. And the kind of image, I would assume that heavily filtered or blurred objects can make it slower. Of course that could easily be mitigated by stopping the loop after a specific timeout / when the settings got changed and a global flag is set.
All that being said, I would be happy to see JPEG export, without any special treatment like telling people what to do. Just add it next to PNG export as an alternative for people to use. And when they want to shoot themselves in the foot: hand them more rope.
Tobias
PS: I used the "Export PNG Image" exporter, not the one from the save dialog which seems rather useless to me.
[...]