GSoC/GCI Archive
Google Code-in 2010 KDE

Create a Simple Mixing Brush, Stage 2

completed by: Natan Yellin

mentors: Pentalis

PREAMBLE

Krita is a KDE program for sketching and painting, offering an end–to–end solution for creating digital paintings.

In Krita, brush engines are known as 'painting operations' or paintops for short. Each paintop is a plugin, a piece of code that's not fundamental to build Krita, but can be added for extra functionality (in this case, the extra functionality is a new brush engine).

Historically, Krita is missing a mixing brush, the closest to color mixing in the current collection of brushes is the smudge brush.

In this epic journey, your mission is to put an end to this lack of a mixing brush, one task at a time. This 'campaign mode' task is divided in several stages such that others can continue if the first contributor leaves, and to let you claim credit for several tasks if you complete the whole campaign.

 

ATTUNEMENT TASK

***You must complete this task before you can claim any task in this campaign***

Mission: Get Krita to build on your computer.

Instructions:

http://wiki.koffice.org/index.php?title=Build_KOffice

You need a working GNU/Linux install in your computer.

 

THE TASK

***You must complete all previous stages before you can claim this one***

Stage: 2

Mission: Discover how to extract colors from the canvas and how to paint colors to the canvas.

Instructions: Modify your new paintop to extract colors from the canvas and paint based on them, and to paint with a color chosen by you (whatever color you want).

This stage has no step by step guide because there is no single way to solve this problem, that is the beauty of it. Now you are free to experiment.

Also I have a secret hint for you. Your would be mentor tried to tackle this problem before, you will find this attempt documented here:

http://mail.kde.org/pipermail/kimageshop/2010-March/008457.html

Horrible indentation and Spanish comments aside, there are a few commands that can help you in there. If you feel like an independent researcher, you can look them up in Krita's documentation here:

http://www.koffice.org/developer/apidocmain.php

I will save you a little time and tell you that if you read the e-mail exchange, one of the solutions for the problem is using KoMixColorsOp. If you feel you have a better solution, all the better. Implement it (that is, code it) and show it to us, after all, this mission is not that complex, you don't need an entire paintop. Just sending the relevant lines of /correct/ code is enough to pass.

IRC channel: #Krita at irc.freenode.net