Skip to content

GSoC’21: Week 4-7 with Krita

Monday, 26 July 2021 | Santhosh Anguluri


Hi reader! It’s been some time since I have posted a blog on my GSoC project. I am writing this blog to keep you updated with the development of Krita. To avoid duplicating code I have gone through relevant part of existing code in Krita (again). I must say it always amazes me as the first day as I explore through the code. Let’s talk a bit about ‘copying layers to clipboard’.

Before this project, Krita can copy a layer’s paint data over a selected region which can be pasted on other layers. Now a duplicate layer of all selected layers are created with the paint data of only the selected region. So I have first created an exact duplicate of all selected layers. Then the paint data of these new layers are trimmed to selected region only. Then these layers are copied to the clipboard in the same order of their original layers.

In case of a vector layer, a new paint layer with the projection of the vector layer is created and trimmed as described above before saving to the clipboard. For Copy Merge operation, a new layer with entire projection of the image over the selected area is saved. Now that the layers are successfully entered the clipboard, it’s time to retrieve out of it.

Meanwhile first evaluations came right through and I have succesfully passed the evaluation. Thanks to my mentors and all the core developers of Krita. In addition to that I have written documentation for a feature that I have worked on before GSoC (rotation of ellipse and rectangle tools). You can find it here: MR 234

Coming back to GSoC, there are various paste operations such as, directly paste all layers in the current image, create a new image and paste over it, paste on active layer, paste at current position. All these paste operations have a paste factory of their own. In the background, I have created a method to create a paint device that satisfy the needs of these factories so that all these features work seamlessly with the new design of clipboard data.

Now all of my work must go through a few cycles with mentor reviews and modifications to make the features work better and to have the code a meaningful flow. You can find my work over here: MR 888

Thank you for reading.

Stay safe and keep building!