{"action":"created","issue":{"url":"https://api.github.com/repos/callaa/Drawpile/issues/191","labels_url":"https://api.github.com/repos/callaa/Drawpile/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/callaa/Drawpile/issues/191/comments","events_url":"https://api.github.com/repos/callaa/Drawpile/issues/191/events","html_url":"https://github.com/callaa/Drawpile/issues/191","id":70340968,"number":191,"title":"Erase all pixels on a layer based on their RGB value / draw BEHIND brush mode","user":{"login":"blurymind","id":6495061,"avatar_url":"https://avatars.githubusercontent.com/u/6495061?v=3","gravatar_id":"","url":"https://api.github.com/users/blurymind","html_url":"https://github.com/blurymind","followers_url":"https://api.github.com/users/blurymind/followers","following_url":"https://api.github.com/users/blurymind/following{/other_user}","gists_url":"https://api.github.com/users/blurymind/gists{/gist_id}","starred_url":"https://api.github.com/users/blurymind/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blurymind/subscriptions","organizations_url":"https://api.github.com/users/blurymind/orgs","repos_url":"https://api.github.com/users/blurymind/repos","events_url":"https://api.github.com/users/blurymind/events{/privacy}","received_events_url":"https://api.github.com/users/blurymind/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/callaa/Drawpile/labels/Feature","name":"Feature","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":19,"created_at":"2015-04-23T08:02:47Z","updated_at":"2015-06-24T17:36:57Z","closed_at":null,"body":"note:\r\nI moved this out of https://github.com/callaa/Drawpile/issues/180 so it is easier to discover and discuss individually.\r\n\r\nThe request:\r\n\r\nAdd these layer commands (to the layers menu or as a tool) that can be assigned to shortcuts:\r\n- Clean up lines with current color (on layer) - deletes all the black, cyan or red pixels on the layer - depending on what user has selected for current color from the \"sketch\" palette\r\n- Colorize lines to current color (on layer) - colorizes all the pixels on a layer to black, cyan or red - depending on what user has selected for current color from the \"sketch\" palette\r\n- Add a \"sketch\" palette  preset with 3 sketch colors. (cyan,black and red).\r\n\r\nBenefits:\r\nIt is a feature that would be beneficial if you are doing animation on single layers https://github.com/callaa/Drawpile/issues/180 and need to clean it up (as you do in most cases).\r\nIt would also be beneficial to sketching in general - simplifying the process by eliminating the need to create and use multiple layers in order to clean up your sketch before coloring.\r\n\r\nExample in other software:\r\nOne way to be able to sketch, clean up and ink a drawing without the need to use multiple layers is to do it like tvpaint - \r\nhttps://vimeo.com/57043308  (see at 5:28)\r\n\r\nIt has 4 compositing inks that can be erased individually - red, cyan, green and black.\r\nThe user sketches in one color (cyan), then for the second pass sketches with another color(black) over the old color. Then with a single click of a button, he erases the first color that is underneath (cyan) and gets a clean drawing with only the second pass (black).\r\nIf he wants to further refine the drawing, the artist turns the cleaned sketch he has (black ink) into a another color (cyan) again - with a single click. Then repeats the process.\r\n![tvpaintrgbpanelsketch](https://cloud.githubusercontent.com/assets/6495061/7229931/cbd98ab8-e771-11e4-82bf-d5fe5d954d58.png)\r\n\r\nThis is really a fantastic way to work on a single layer and mimics the traditional animator workflow as well! In traditional animation animators sketch with the cyan pencil, then sketch with the black pencil on top of the cyan. Then erase the cyan pencil with an eraser that only affects it.\r\n\r\nI am not sure how hard it would be for you to get a color by it's rgb value on a layer and erase it, or colorize it to another rgb value. Tvpaint has 4 colors to do this workflow, but you can really get away with two - cyan and black."},"comment":{"url":"https://api.github.com/repos/callaa/Drawpile/issues/comments/114950306","html_url":"https://github.com/callaa/Drawpile/issues/191#issuecomment-114950306","issue_url":"https://api.github.com/repos/callaa/Drawpile/issues/191","id":114950306,"user":{"login":"callaa","id":464576,"avatar_url":"https://avatars.githubusercontent.com/u/464576?v=3","gravatar_id":"","url":"https://api.github.com/users/callaa","html_url":"https://github.com/callaa","followers_url":"https://api.github.com/users/callaa/followers","following_url":"https://api.github.com/users/callaa/following{/other_user}","gists_url":"https://api.github.com/users/callaa/gists{/gist_id}","starred_url":"https://api.github.com/users/callaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/callaa/subscriptions","organizations_url":"https://api.github.com/users/callaa/orgs","repos_url":"https://api.github.com/users/callaa/repos","events_url":"https://api.github.com/users/callaa/events{/privacy}","received_events_url":"https://api.github.com/users/callaa/received_events","type":"User","site_admin":false},"created_at":"2015-06-24T17:36:56Z","updated_at":"2015-06-24T17:36:56Z","body":"![color_erase1](https://cloud.githubusercontent.com/assets/464576/8336683/df658710-1aae-11e5-8ed8-21cbb4be2ab2.png)\r\n\r\nIn the above image, the horizontal lines were drawn first and the vertical lines were drawn after, but with the \"Behind\" blending mode.\r\nRed, green and blue color erase was applied to the three groups on the right.\r\n\r\nIt looks like the color eraser isn't quite as simple as I thought. Even thought blending primary colors does not mix the channels, it can still cause the other color channels to darken. I would guess this happens in tvpaint too if you paint semi-transparent blue over black?\r\n\r\nI noticed that Gimp has a pretty good color erase mode that can work with any color (although in this use case, the palette should still be limited to R/G/B for clean separation). I'll see if I can adapt their blending code."}}