Skip to content

Instantly share code, notes, and snippets.

@Electronix1337
Last active September 6, 2022 13:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Electronix1337/7ab2a4fc0294b6524e7a583cf44a8836 to your computer and use it in GitHub Desktop.
Save Electronix1337/7ab2a4fc0294b6524e7a583cf44a8836 to your computer and use it in GitHub Desktop.
Google Summer of Code 2022 Project for Paintroid - Documentation

About the project

During the last three months of Google Summer of Code, as a Student Developer, I worked on an extremly helpful tool for the app Pocket Paint (https://play.google.com/store/apps/details?id=org.catrobat.paintroid&hl=de_AT&gl=US) which is a image manipulation app by Catrobat (https://catrobat.org/).

Main work

The main work of my GSoC 2022 project was to implement a new tool, called "clipping tool" which is present in nearly every image manipulation program and facilitates the usage of the app.

With this new tool the user is able to mark an area and when applying the tool or switching to another tool with a marked area already drawn, everything except the marked area will be erased. The path for the marked area can have any color but depending on the tool color, the path either has a white contour (when black is the current tool color) or black otherwise.

In order to have an actual closed area to properly clip I decided to do the same as i.e. Photoshop and just draw a last line from the last coordinate (where the user released the finger) to the initial coordinate to have an actual closed marked area to clip. I did not find out yet why sometimes the line is an actual line and sometimes the patheffect of the toolpaint actually applies and a dashed line will be drawn.

I made some case distinctions in order to make the usage of the tool easy and predictable.

The three cases are:

  1. When marked area is already drawn and user tries to draw another area the old area will just be deleted and the new area will be drawn on the canvas.
  2. When marked area is drawn and user presses undo, the marked area will just be deleted.
  3. When marked area is drawn and applied and user presses undo, the bitmap before clipping will be displayed, as the path command for the marked area will be deleted from the undo/redo list, also color changes will not be undo/redo-able as discussed with the product owner of the app.

Here are some demos to see how using the tool looks like:

Click for demo on black bitmap with undo and redo:
Click for demo on pink bitmap with redrawing marked area and color change:
Click for demo on actual face:

PR of clipping tool: https://github.com/Catrobat/Paintroid/pull/1125/files Issue: https://jira.catrob.at/browse/PAINTROID-432

Further Work

Code reviews

After finishing the main task of this years GSoC 2022 I also did several code reviews for other members of Paintroid:

Implementation of layer extension

I also implemented another really helpful extension for Paintroid which allows the user to add more layers (100 to be exact) than the original 4 layers and reorder, merge or move them via drag and drop.

Further details on the implementation can be found on the link below.

PR: Catrobat/Paintroid#1136 Issue: https://jira.catrob.at/browse/PAINTROID-420

Last but not least I gave myself a try to fix some bugs but as I was not able to reproduce those bugs and also no member was able to, I decided to rather do some more code reviews as there were a lot of tickets in the "ready for review" category on Jenkins.

Summary

To conclude this page I want to point out that the project as a whole is amazing and I truly enjoyed working on it.

As I was already a part of this project before GSoC 2022, I knew all of the members and would like to thank everyone participating in this awesome open-source project.

Special thanks to my GSoC 2022 mentor Michael Herold as well as Catrobat for giving me the opportunity to extend my knowledge base and show off my love for programming and especially open-source projects and of course to Google for providing such awesome project for motivated and committed developers.

In case you want to connect with my via social media, here is the link to my Linkedin profile: https://www.linkedin.com/in/michael-tiefnig-b764481b3/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment