Inkscape Paintbucket does not fill when zoomed in too far

Bug #1506715 reported by Cory Albrecht
30
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Inkscape
Triaged
Low
Unassigned

Bug Description

When zoomed in too far and using the bucket fill tool, Inkscape will "think" for a a bit with the waiting mouse cursor, and then nothing will happen. No new entry appears in the history list to undo.

Steps to replicate

1. Obtain an image with complex paths which will be the edges of the area to fill, such as a one of the SVG base maps from Wikipedia

2. Zoom in to 800% or 1600% so the edges of the filled area will be better fitted to the complex paths used as edged instead of the approximation that painting at a lower or no zoom will use and leave gaps

3. Make sure that one edge is in view

4. Select the paint bucket tool and click inside the area to paint

5. Watch the mouse cursor in the waiting state for several tens of seconds to a minute or two while Inkscape "thinks" and eventually returns to the paint bucket cursor with no change to the image

6. See that there is no new action to undo in the history list

There is no error indicating that anything went wrong, it is as if you never tried to fill in the area.

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

Please add information about OS/platform and Inkscape version to the bug description, thank you.

To allow further investigation of the reported issue, please attach a reduced test case (Inkscape SVG file) to the bug report which consistently reproduces the issue on your system as described.

Changed in inkscape:
status: New → Incomplete
tags: added: color
removed: bucket fill paint
Revision history for this message
Hachmann (marenhachmann) wrote :

I get that, too (0.91, LM 17.2, 64bit).
Status line says 'area is not bounded, cannot fill'. Zoom out just a tiny bit or move the object a little more onto the canvas and it will work.

The manual says
"Since the Paint Bucket Tool uses pixels to calculate the area to be enclosed, Inkscape will clip the region off-screen to prevent the number of pixels that go into the filling algorithm from becoming too large. If this happens you can either zoom out to do the fill or you can do the fill in pieces. "
http://tavmjong.free.fr/INKSCAPE/MANUAL/html/Bucket-Union.html (also see images there)

So from the manual, I conclude that it is expected that the bucket tool fills until the borders of the visible canvas (probably only *if* the area is bounded? But how will it know the difference?) or until a color change.
But if the area-to-fill is outside the visible area by a certain amount, it just doesn't fill anything.
'Doing the fill in pieces' doesn't appear to be possible.

Revision history for this message
Hachmann (marenhachmann) wrote :

Edit: it does work, sorry. But only if the object is not going over two opposing edges of the canvas.

Revision history for this message
Hachmann (marenhachmann) wrote :

Screenshots. Maybe this is even intentional?

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

Please attach a (reduced) test case (Inkscape SVG file - before|after) - a screenshot does not really help to further investigate this on other systems - and also provide details about the chosen settings of the paint bucket tool (I fail to decipher them on the downscaled screenshot).

Keeping status as 'Incomplete' for now.

Possibly related earlier reports:
Bug #836813 “Fill Tool Inconsistences” (see comment 2)
Bug #190103 “paint bucket incomplete fill when zoom in”

Revision history for this message
Hachmann (marenhachmann) wrote :

The problem seems to appear with any object... It doesn't matter how big, or if it is rotated. It only depends on parts of the object being outside the visible area.

So far, I got the partial filling now with an object that crosses two opposite borders, too (which is the correct behaviour, according to the manual). But zooming in a little more, and 'area is not bounded'.

Just click into the middle of the visible part of the rectangle in page zoom (numpad 5) in the appended file (just in case it could be relevant: my screen resolution is 1280:1024, using Inkscape in normal full window mode).
An 'after' file doesn't make much sense imho, because really nothing happens.

Revision history for this message
Hachmann (marenhachmann) wrote :

https://bugs.launchpad.net/inkscape/+bug/836813 seems to be about the same thing, yes.

Revision history for this message
Cory Albrecht (bytor) wrote :

This is Inkscape 0.91 running on Ubuntu GNOME 15.04.

Hachmann, that 836813 bug you linked to does appear to be similar.

Based on what I remember, yes, there were two opposing sides where the object was off the screen. Three actually, since I was zoomed in to 1600%.

I've attached the map SVG I was working with. It's 1401 pixels wide by 1198 high, so a fair sized image, and the object I was painting (the Russian Empire) is about one fifth to one quarter of the size of the page. I'm filling in on the layer called "Edge Colours" and I made invisible the "Text", "Cities", "Rivers", and "Lakes" layers which are above the filling layer. The filled object is copied and then pasted in place in the "Inset Colours" layer, changed to a slightly lighter tint and then inset path is applied four times

I need the fill to match the border or coastline as closely as possible. Filling at no zoom leaves obvious unfilled spots, as does filling at 200% zoom or even 400% zoom. 800% seems to be the minimum zoom to get enough fidelity on the filled area's edge matching the coastline or border such that a grow/shrink of 0.4, which is half that of the width of the border & coast lines (0.8). A grow/shrink for the bucket fill of larger than that results in little fingers of colour poking beyond the border or coastline, and less results in white spots between fill and the border/coastline.

The map is exported as PNG for the final use, but the fidelity of the fill edges and border/coast lines is important because portions are cut from a 4 or 8 times zoomed PNG to be used as insets like one often sees in atlases.

The partial filling I can handle, I little bit more work for the artist, but shift+click unions the areas together for what is practically the same result.

But the area unbounded (which disappears from the status area if you move the mouse, BTW, which is why I missed it) error is not only extremely frustrating, but makes no sense when combined with the partial fill that clips the painting area if it goes beyond the viewport. Why doesn't that clipping happen in this case? Naïvely, one would think that the clipping would happen.

su_v (suv-lp)
Changed in inkscape:
status: Incomplete → New
Revision history for this message
su_v (suv-lp) wrote :

Confirmed - there are situations where filling fails unexpectedly for the user; for example depending on whether or not a traced area is bounded at the right or bottom within the rasterized area (visible screen at zoom level * 1.6). Other aborted traces seem to differ for bounds determined on the left or top side (any bounds detected on the left side may depend on objects fully within or exceeding the screen area to the left, the mirrored situation along the top side though does not AFAICT).

Possibly limitations of the chosen scan-line-processing of the area traced for pixels within the threshold - this would have to be analyzed by a developer familiar with the details of the implementation (whether it is a bug in the implementation or details which could be improved (wishlist)):
https://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/14419/src/ui/tools/flood-tool.cpp#L713
https://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/14419/src/ui/tools/flood-tool.cpp#L582

For visual debugging, comment out these lines:
https://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/14419/src/ui/tools/flood-tool.cpp#L796
to dump the rasterized area used for the scanline checks to a PNG file (in current working dir).

Changed in inkscape:
status: New → Confirmed
jazzynico (jazzynico)
Changed in inkscape:
status: Confirmed → Triaged
importance: Undecided → Low
Revision history for this message
Cory Albrecht (bytor) wrote :

I'm still getting this in Inkscape 0.91 on Ubuntu 16.04. Since it works when the object only goes off one edge of the viewport and stops a bit beyond that, why cannot *all* edges of the viewport work the same way? Then this "Area is unbounded, cannot fill" would never happen.

Revision history for this message
Cory Albrecht (bytor) wrote :

Actually, I just had it happen when three sides of the region to be painted were bounded on screen and only one side was open and going out of the viewport.

Revision history for this message
me@pauloldridge.com (l-me-s) wrote :

I'm having this problem on 0.91 in Ubuntu 16.10 . I can't get it to work at all, whether or not the object goes off an edges of the viewport

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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