Exporting additional empty space when using filter

Bug #611649 reported by snowdrop
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Low
Unassigned

Bug Description

When I try to export marked objects in Inkscape the PNG export gets much added transparent "padding" on both the left and right. This however only happens when I add a filter (mosty the Drop Shadow) to the PNG import that is also included in what I mark for export, along with everything else. This is shown in the screenshot that's included:

1. In my case I am creating a card. The template is all vector, made in Inkscape.
2. I then import a PNG, place it on the template.
3. I add the drop shadow effect to the PNG import. When I do that, suddenly the import gets added transparency and size on the sides.
4. When marking it all and exporting, the export gets this added transparency included.

In effect, this is a huge problem because when I try to set the size of the export I can't ever get it correct since the export includes x amount of transparent padding, which of course makes the stuff I try to export smaller.

If I remove the filter and mark it all again the extra padding is gone.

Revision history for this message
snowdrop (snowdrop) wrote :
su_v (suv-lp)
tags: added: filters-svg selection
removed: export filter import
Revision history for this message
su_v (suv-lp) wrote :

The "added transparency and size" is the filter effects region and needed to not cut off the any edges of applied filter effects. This is intentional - otherwise the drop-shadow could be cut off from exported bitmaps (see bug #168349 and duplicates about cut-off blurs without a better bounding box calculation for bitmap export).

<http://tavmjong.free.fr/INKSCAPE/MANUAL/html/File-Export.html#id4336766> describes how to use hidden rectangles to select an export region for bitmap export, if you need to cut-off filter effect regions arbitrarily. You could also manually edit the extend of the region in the filter effect dialog (in the Tab 'Filter General Settings' at the bottom).

Proposing to close as 'Invalid' - with regard to the dimensions of the current selection for exporting to bitmap.

Otherwise maybe the report could be turned into a feature request for the 'Shadows and Glows' filter effects extension to calculate the filter effects region more tightly based on the actually entered parameters for blur radius and offset, instead of always using fixed dimensions of 1.5 x 1.5.
But note that there will always be an enlarged selection frame for objects with a drop shadow by nature of that effect.

Revision history for this message
su_v (suv-lp) wrote :

Inkscape » Filter Effects—Custom » Basic Use: Filter Effects Region
<http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Filters-BasicUse.html#Filters-EffectsRegion>

Revision history for this message
snowdrop (snowdrop) wrote :

I admit not understanding half of what you referred me to due to lack of insight in how Inkscape and/or the filter works. That said, I am very clear about that a drop shadow and other effects _must_ and _should_ in some cases add to the dimensions of the raster area.

What I don't understand is why the added space seems, in the case of the drop shadow, to be _totally_ unwarranted and unrelated to how the drop shadow has been applied. I have included 2 screeshots showing this below.

Shot: Right Raster selected, after dropshadow has been applied. I have been staring at it for a while now and I can't figure out where exactly on that image the dropshadow is even _close_ to the borders of the new supersized area. The way I have applied the effect doesn't warrant that enlargement. (Notice: Maybe it does to the coders of the filter(s) or Inkscape, as it could be a purely technical question, However, I'm speaking from the point of the actual end user - to him/her this behaviour is totally out of the blue and not "logical" in any way...)

Surely the default behaviour should not be like this?

Also, while this is indeed disurbing while working in Inkscape since the raster area now could overlap a dozen other areas and objects etc, making it harder to mark and what not, the original problem is still there when exporting it to PNG: The exported file will have plenty of totally empty space that does not contain drop shadow or anything else because of this issue. In effect, the user has to enter GIMP or whatever and manually edit it + also gets the wrong size of her export to begin with.

Revision history for this message
su_v (suv-lp) wrote :

> What I don't understand is why the added space seems, in the case of
> the drop shadow, to be _totally_ unwarranted and unrelated to how the
> drop shadow has been applied. (...)
> Surely the default behaviour should not be like this?

That's what I was referring to in the 'turn into a feature request' part of my first comment.

> the original problem is still there when exporting it to PNG:
> The exported file will have plenty of totally empty space that
> does not contain drop shadow or anything else because of this issue.

You can export arbitrarily sized slices of the SVG file using the technique described in the 'Slicing a Drawing' section [1] of the 'Exporting PNG' manual page (invisible rectangle(s) on a separate layer).

[1] http://tavmjong.free.fr/INKSCAPE/MANUAL/html/File-Export.html#id4336766

Revision history for this message
snowdrop (snowdrop) wrote :

I appreciate all the help I've gotten from you and I've also successfully used the slice-method =) While this is a somewhat bulky "work around", it at least works, even if it's not far from doing the same thing in GIMP, at least for my purpose with creating a card.

Even so, I claim this is indeed a bug, or at least something that works so differently than expected that it is a problem that should be, in order of priority ofc, fixed.

Revision history for this message
jazzynico (jazzynico) wrote :

The drop shadow filter's size could indeed be calculated with a higher accuracy. The 1.5x1.5 dimension is not appropriate for low blurs (too much empty space) nor for high values (imaged clipped).

Changed in inkscape:
assignee: nobody → JazzyNico (jazzynico)
importance: Undecided → Low
status: New → Triaged
jazzynico (jazzynico)
Changed in inkscape:
assignee: jazzynico (jazzynico) → nobody
Revision history for this message
San Siro (sansirofult) wrote :

It happens for me now for all filters not only one of them in Inkscape 0.92. I really hate to adjust dimensions from Filter General Settings tab. Is there any settings to set dimension as 1 for all filters as default.

Thanks.

Changed in inkscape:
status: Triaged → Confirmed
status: Confirmed → New
Revision history for this message
jazzynico (jazzynico) wrote :

Thanks for your comment.
Please don't change the bug status. Triage means that the bug was confirmed and the Inkscape team agreed it needs to be fixed.

Changed in inkscape:
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.