Fix the Bucket Tool


I suppose that fixing the paint bucket tool is part of the roadmap. Is somebody already working on it or planned to work on it? At the moment this tool is almost unusable.

A suggestion would be to have it behave the same way as on Toon Boom : It closes a shape if the shape is not closed.

What do you all think?


@feeef , It’s really a nice idea.

But nobody is plan to work on bucket tool for now. Are you interested in improving it?


Yes @chchwy ! I will try to fix some bugs on that feature.

However, I have been talking to @manuel_odendahl about that and he said that the drawing engine will need a good refactoring in order to be really stable and easily upgradable.

My knowledge in QT and in Pencil is still a bit too weak for me to handle such a big work.

If this refactoring is planned for v0.5 or v0.6 we may open a topic about it. What do you think?


I am trying to change the behavior of the current floodFill() function on the vector layer but it is really hard as the code is complicated and very difficult to understand.

I think that the best would be to do a new function that works with paths. It would find the nearest path around the point where the bucket was applied. Then, it would close the path if required. Finally, it would fill the path by creating a new filled vector shape that would be independent from the original path (could be moved or removed).

What do you think?


Hi @feeef,

I can see you are helping the developers a lot. And thank you for that!

I read your last comment and I would like to ask you about this:
"…it would fill the path by creating a new filled vector shape that would be independent from the original path (could be moved or removed)"

In which “layer” are you intending to create the new filled vector shape? On the same vector-layer?

(I edited this comment)



I assume it would be the same layer. Vector shapes, unlike raster shapes, are all separate objects that can easily be selected and manipulated individually, so having outlines and fills on the same layer does’t present the same problems you have when mixing lines and colors on raster layers.


Oh I see. I was thinking it could be on another vector-layer, but yes you are right, I was previously thinking on bitmap layers. :slight_smile:



Current floodFill() is very very complicated, I saw it once before and I don’t want to touch it again. Maybe to write a new floodFill() is a solution.




@kaiko, @mikshaw,

Yes it will be the same layer. Just 2 different elements in the same vector layer.


OK. Thank you…
We hope you can contribute to improve the filling feature… :slight_smile:


I am back on this task with the exact same goal. I am rewriting the entire floodFill method. It should take me some time as it is a pretty complicated task.

I’ll keep you updated in this thread.


I have been quite active in the development for the last few days. I had some time and I spent it on Pencil.

I am still working on the bucket tool and the flood fill function that I am re-implementing in the vector engine. Having a fill algorithm that works well in a vector based environment is very complex (especially as I don’t want to refactor the whole vector engine). So I study the issue very closelly and I experiment. I have been experimenting a few concepts and I am reaching something I am pretty happy with.

Being an animator helps me know what I need in a professional vector drawing environment and I am working on getting there.It will not be perfect but it should be usable for any situation.

As well as the fill tool I have implemented a “paint behind” brush tool that can be used to fill the little gaps left by your fill tool. It can be very usefull to get a very clean result. I have used the brush tool in the vector engine for that.

I will try to finish this entire feature this week and share it with you.

I’ll let you know! :wink:


Glad to hear that you continue to work with Pencil feeef! Thank you for spending your time with this. Some people on our main 2d animation forum in Russia is interesting for Pencil2d features and development. sfepa and me are one of them. I’m sure that many people all over the world will be grateful to you for your work. I’ll be watching for this topic.


I have made a screencast video describing the updates I have done on the bucket tool and the main vector engine. I published it here :
The quality of the inline video may not be very good but you can check the original file (there is a download link on the page) if you want better quality

Please, let me know if you have any comment.


@feeef , no comments! it looks cool! thanks for your work!


@feeef, this is really amazing. You just brought pencil back to life again! I feel excited again. thanks for your work


Thanks for your hard work! The features that you are working on look fantastic! It looks like some of the changes that you are working on haven’t been implemented. I look forward to sharing these software with my elementary school students someday!


Thanks a lot @computerartclub !

The bucket tool in the vector layer is still not perfect. It still has some bugs and limitations but I will work to improve it.

Hopefully, we will release a new version soon so you should be able to enjoy it with your students soon! :slight_smile:


Fantastic! Thank you! We look forward to it!