Bug 217292

Summary: Ability to paint transparency masks
Product: [Applications] krita Reporter: Kubuntiac <user581>
Component: GeneralAssignee: Halla Rempt <halla>
Status: RESOLVED FIXED    
Severity: major CC: halla, nezumi, pentalis, tysontanx
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Unspecified   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Kubuntiac 2009-12-04 05:01:53 UTC
Version:            (using KDE 4.3.4)
Installed from:    Ubuntu Packages

In both photoshop and Gimp, layer masks (called transparency masks in Krita as far as I can tell) are black and white images that can be painted and modified by any tool that can modify colour. Being able to use the full power of the brushes (which is many times more powerful in Krita) makes mask creation very flexible.

In Krita I only seem to be able to work with a transparency mask by selecting an area and then choosing Add Transparency Layer. It would be  very useful to be able to tweak these layers, especially by painting as in other raster editors.

Thankyou! :)
Comment 1 Sven Langkamp 2009-12-04 05:10:40 UTC
That's already possible. It's done a bit different in Krita as you have to use eraser and brush instead of black and white.
Comment 2 Kubuntiac 2009-12-04 07:01:52 UTC
Thanks Sven,

That would be a decent way of doing it too. I think there must be a bug though (or I'm doing it wrong). Pixel eraser does seem to work on the transparency layer, but paint does not (at least the pixel brush and the pixel pencil).

Could you confirm if this currently works for you. I updated thismorning to revision 1058144 on Kubuntu 9.10 AMD64 with KDE 4.3.4.

Thanks!
Comment 3 Kubuntiac 2009-12-04 07:18:30 UTC
Actually, I looked a bit closer and found that the pixel eraser wasn't changing the transparency layer either. It was erasing from the paint layer! (even though I had the transparency layer selected). :`(

So I'm either doing something pretty wrong, or somethings broken....

If it works for you could you outline what you did to test it?
Comment 4 Kubuntiac 2010-02-23 09:52:58 UTC
Hmmm... looking closer at this there seems to be one big differentce. As far as I can tell there's only one level of transparency. In Gimp / Photoshop you can paint semi-transparencies by using a grey brush. I tried using a grey brush with "select by brush" without any difference. It may be part of some larger issues my install seems to be having with transparency masks, though.
Comment 5 Halla Rempt 2010-02-23 10:09:37 UTC
It should be using the opacity channel, not the grayscale channel. But I am sure we'll be finding more bugs here.
Comment 6 Halla Rempt 2011-05-20 17:15:52 UTC
Upgraded to normal bug, assigned to Dmitry.
Comment 7 Halla Rempt 2012-02-11 10:19:48 UTC
This way too tricky to finish before the release, so I have to postpone it :-(. Currently, I think the best solution would be to add a new grayscale paint device to the KisMask class, and expose that in KisMask::paintDevice(). The synchronization with the selection is tricky, though I think I might have a solution for that as well.
Comment 8 Halla Rempt 2012-05-15 09:12:56 UTC
*** Bug 273920 has been marked as a duplicate of this bug. ***
Comment 9 Halla Rempt 2012-07-13 08:31:23 UTC
*** Bug 303457 has been marked as a duplicate of this bug. ***
Comment 10 Halla Rempt 2012-08-23 14:34:04 UTC
*** Bug 305666 has been marked as a duplicate of this bug. ***
Comment 11 Dmitry Kazakov 2013-03-26 11:51:28 UTC
Git commit 44dfdb91011c3431006108e372a5014eebb6f993 by Dmitry Kazakov.
Committed on 26/03/2013 at 11:39.
Pushed by dkazakov into branch 'krita-testing-kazakov'.

Implemented an ability to paint with gray color on the selections

This patch introduces a property for a KisPaintDevice class:

const KoColorSpace* KisPaintDevice::preferredDabColorSpace() const

This property tells the user which color space is preferred to be used
for dabs, those are going to be bitBlt'ed to the paint device.
The necessity if such separation is defined by the fact that some color
spaces are not good for composing colors (i.e. alpha8()) so
the composition result will be more sane if the dab is prepared in
a better color space.

TODO: there are a few bugs still:
1) There are a few color conversion code duplications in the paint ops,
   which read the data from the layer's (not dab's) device. This should
   be wrapped into a separate class, which would also solve the performance
   doubts.
2) The SmudgeOp doesn't work on the selections, due to problem 1)
3) The Experimental Paint Op doesn't remove color in non-mirroring modes,
   because alpha8() color space doesn't have COMPOSITE_COPY op, which can
   be easily fixed.

M  +6    -6    krita/image/kis_fill_painter.cc
M  +2    -2    krita/image/kis_fixed_paint_device.cpp
M  +2    -2    krita/image/kis_fixed_paint_device.h
M  +10   -217  krita/image/kis_gradient_painter.cc
M  +5    -1    krita/image/kis_paint_device.cc
M  +10   -1    krita/image/kis_paint_device.h
M  +80   -99   krita/image/kis_painter.cc
M  +2    -6    krita/image/kis_painter.h
M  +7    -27   krita/image/kis_pixel_selection.cpp
M  +1    -1    krita/image/kis_pixel_selection.h
M  +0    -37   krita/image/kis_selection.cc
M  +0    -3    krita/image/kis_selection.h
M  +0    -18   krita/image/kis_selection_based_layer.cpp
M  +1    -20   krita/image/kis_selection_based_layer.h
M  +13   -14   krita/image/tests/kis_painter_test.cpp
M  +48   -0    krita/image/tests/kis_pixel_selection_test.cpp
M  +2    -0    krita/image/tests/kis_pixel_selection_test.h
M  +3    -1    krita/plugins/extensions/dockers/advancedcolorselector/kis_color_selector_base.cpp
M  +2    -2    krita/plugins/paintops/chalk/kis_chalk_paintop.cpp
M  +1    -1    krita/plugins/paintops/curvebrush/kis_curve_paintop.cpp
M  +8    -8    krita/plugins/paintops/defaultpaintops/brush/kis_brushop.cpp
M  +1    -1    krita/plugins/paintops/defaultpaintops/brush/kis_brushop.h
M  +36   -65   krita/plugins/paintops/deform/deform_brush.cpp
M  +0    -4    krita/plugins/paintops/deform/deform_brush.h
M  +36   -50   krita/plugins/paintops/deform/kis_deform_paintop.cpp
M  +1    -1    krita/plugins/paintops/dynadraw/kis_dyna_paintop.cpp
M  +1    -1    krita/plugins/paintops/experiment/kis_experiment_paintop.cpp
M  +9    -5    krita/plugins/paintops/gridbrush/kis_grid_paintop.cpp
M  +0    -1    krita/plugins/paintops/gridbrush/kis_grid_paintop.h
M  +4    -1    krita/plugins/paintops/hairy/hairy_brush.cpp
M  +3    -3    krita/plugins/paintops/hairy/kis_hairy_paintop.cpp
M  +1    -1    krita/plugins/paintops/hatching/kis_hatching_paintop.cpp
M  +3    -3    krita/plugins/paintops/libpaintop/kis_color_source_option.cpp
M  +9    -3    krita/plugins/paintops/libpaintop/kis_pressure_flow_opacity_option.cpp
M  +2    -1    krita/plugins/paintops/libpaintop/kis_pressure_flow_opacity_option.h
M  +2    -1    krita/plugins/paintops/libpaintop/kis_pressure_flow_opacity_option_widget.cpp
M  +1    -1    krita/plugins/paintops/particle/kis_particle_paintop.cpp
M  +1    -1    krita/plugins/paintops/sketch/kis_sketch_paintop.cpp
M  +2    -2    krita/plugins/paintops/spray/kis_spray_paintop.cpp
M  +15   -10   krita/plugins/paintops/spray/spray_brush.cpp
M  +1    -1    krita/plugins/paintops/spray/spray_brush.h
M  +1    -1    krita/plugins/tools/defaulttools/processings/fill_processing_visitor.cpp
M  +0    -4    krita/ui/flake/kis_shape_selection.cpp
M  +1    -1    krita/ui/tool/kis_tool_paint.cc
M  +1    -1    krita/ui/tool/strokes/kis_painter_based_stroke_strategy.cpp

http://commits.kde.org/calligra/44dfdb91011c3431006108e372a5014eebb6f993
Comment 12 Tyson Tan 2013-03-31 12:40:09 UTC
>Dmitry
I had built Krita 2.7 alpha from master and was happy to see the mask functionality works like a charm. This commit is going to give artists much more freedom dealing with complicated textures (which was probably the only thing I missed badly from Adobe Photoshop :b) Thank you very much for the effort! Can't wait to put in into practical use! ^^