To convert grayscale to transparency in Krita, follow the following steps:
1: open the image that you want to edit in Krita.
2: select the layer that you want to convert, and add the filter Adjust -> Cross-channel color adjustment to it. In the filter settings, you should see two dropdown list buttons, one for "Channel" and one for "Driver channel," and a curve editor.
3: change "Channel" to "Alpha."
4: change "Driver channel" to "Lightness."
5: make the curve a slope by moving the left point to the bottom-left and the right point to the top-right. Click "OK" to apply the filter.
This will make every pixel in the layer have its alpha value equal to its lightness. Black pixels will become fully transparent, while white pixels will become fully opaque.
However, you'll see some black outlines around the white areas. Those are from gray pixels that became only semi-transparent. To fix this:
6: add a new fill layer. Make its color white if you want all the opaque parts to be white.
7: make the fill layer inherit the alpha from below by clicking its "a" icon in the "Layers" docker next to the padlock.
Note: if you have other layers in the document, you'll have to put the fill layer, the filter, and the grayscale layer in a layer group for the "Inherit Alpha" setting to work.
8: save your image.
Inverting the Colors
The tutorial above will make black transparent and white opaque. To do the opposite, simply follow the same steps but make the slope go to from top to bottom instead of from bottom to top.
Alternatively: before applying the Cross-channel color adjustment, invert the color of the pixels with the Adjust -> Invert filter.
Leave a Reply