This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Is it possible to directly edit the Alpha Channel?

Tags: None
(comma "," separated)
neckbeardslayer
Registered Member
Posts
5
Karma
0
Hey, I've really been digging this program, and I'd love to ditch Photoshop for it, but there's one thing holding me back, and that's the inability to directly control the Alpha channel independent of everything else.

I'm a 3d artist, and my textures need to make use of all four channels (RGBA) within a game engine, not being able to directly control the Alpha is seriously crippling for this purpose. Even a way to select a grayscale mask to write to the alpha channel when exporting a texture would be enough.

I did some googling and this was only relevant thing that turned up.

viewtopic.php?f=137&t=101283

Yes, I tried really hard to fix that for 2.4, but failed. There are two issues here: Krita really assumes that everything you can paint on will always have an alpha channel, otherwise painting won't work. That makes it impossible to have a gray channel-only mask we can paint on. The other is that a selection always only has an alpha channel. That makes it impossible to just use gray+alpha for a mask, since a mask is just a selection.


Has there been any further pursuit of this, or is there some way to control the alpha that I overlooked?
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
No, I haven't worked on it since. The only solution I can think of is to create a special blending mode that would let brushes only work on the alpha channel, or a set of flags that would set the channels on which a brush would work.
User avatar
radian
Registered Member
Posts
89
Karma
1
OS
I'm not sure what exactly you want but I guess there is some workarounds for that.

You can add all layers to group and add transparency mask to that and paint directly on the mask. Also you can convert mask to the paint layer and visa versa. You can export masks as well as other layers.
Hope it will help...
neckbeardslayer
Registered Member
Posts
5
Karma
0
boudewijn wrote:No, I haven't worked on it since. The only solution I can think of is to create a special blending mode that would let brushes only work on the alpha channel, or a set of flags that would set the channels on which a brush would work.


Ah.

Would it be viable to just do it after the fact during the save process by specifying a layer or other image to write to the alpha channel when exporting the image from Krita, thus bypassing the issues you mention with how Krita understands alpha? If that's something that could realistically be done I'd love to pursue it sometime when I'm not super busy with work.

radian wrote:I'm not sure what exactly you want but I guess there is some workarounds for that.

You can add all layers to group and add transparency mask to that and paint directly on the mask. Also you can convert mask to the paint layer and visa versa. You can export masks as well as other layers.
Hope it will help...


As far as I can tell that doesn't work around the issue. In situations where I need a texture where the alpha directly lines up to different levels of translucency (Glass with varying levels of translucency for instance) that's fine, but in situations where the alpha has no relation to the translucency of a texture and is needed other purposes (For instance, defining which areas of a character texture receive team colours, or roughness/metallic maps) it doesn't work because those areas are then removed by the transparency when I save.

Here's an example of how the alpha is utilized, (granted this is just black and white, and the whole range would generally be used, but hopefully this explains it somewhat): https://youtu.be/aelOH9jjt2g?t=820
User avatar
Animtim
Registered Member
Posts
259
Karma
0
OS
Hi,
Actually there is a way to do what you want, using the "inherit alpha" feature.
-on all your layers with RGB content, activate the inherit alpha button, that actually just disables the alpha of those layers. (note: if you use group layers, you need to activate the inherit alpha button only on the group itself not the content, unless you activate pass-through mode of the group layer..)
-on the bottom of the layer stack, paint the layer that will be used for alpha.

-export as png: the result keeps color info where alpha is 0.
neckbeardslayer
Registered Member
Posts
5
Karma
0
Animtim wrote:Hi,
Actually there is a way to do what you want, using the "inherit alpha" feature.
-on all your layers with RGB content, activate the inherit alpha button, that actually just disables the alpha of those layers. (note: if you use group layers, you need to activate the inherit alpha button only on the group itself not the content, unless you activate pass-through mode of the group layer..)
-on the bottom of the layer stack, paint the layer that will be used for alpha.

-export as png: the result keeps color info where alpha is 0.


This does not appear to work unfortunately. Irregardless of whether exporting alpha channel is enabled exporting to PNG does not include an actual alpha channel. Exporting to other formats such as TGA just provides the usual blank white alpha channel.
User avatar
TheraHedwig
KDE Developer
Posts
1794
Karma
10
OS
neckbeardslayer wrote:
Animtim wrote:Hi,
Actually there is a way to do what you want, using the "inherit alpha" feature.
-on all your layers with RGB content, activate the inherit alpha button, that actually just disables the alpha of those layers. (note: if you use group layers, you need to activate the inherit alpha button only on the group itself not the content, unless you activate pass-through mode of the group layer..)
-on the bottom of the layer stack, paint the layer that will be used for alpha.

-export as png: the result keeps color info where alpha is 0.


This does not appear to work unfortunately. Irregardless of whether exporting alpha channel is enabled exporting to PNG does not include an actual alpha channel. Exporting to other formats such as TGA just provides the usual blank white alpha channel.

The transparency checkes need to be visible if you wanna have transparency exported to anything: https://docs.krita.org/Saving_for_the_Web
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
I did fix that, didn't I? It's in https://cgit.kde.org/krita.git/commit/? ... 6220d58b93 -- so maybe try the 4.0 pre-alpha.
tomspratt
Registered Member
Posts
1
Karma
0
Hiya!

Just chiming in to say that I love the look of Krita, its performance and its feature set. So much stuff in here that would be fantastic workflow improvements for game art.

BUT!

Lacking the ability to directly edit and save changes to separate colour channels and specifically alpha is a killer. My team would love to use this otherwise, but I cannot understate how much of a hindrance this missing feature is. Even with base level shaders in an engine like Unity, artists need to work with the alpha channel for Specularity and Smoothness maps. When you move into tech art and custom shaders Red, Green, Blue and Alpha channels are often used for a bunch of unrelated things and need to be cleanly divided!

You've added the ability to disable and enable different colour channels since I last checked in on your progress, but even with other channels disabled you still draw into each channel when editing on the canvas.

I hope this pops back up as a priority at some point.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
It will not automatically "pop back up as a priority" -- it would be a largish project, and as such, we'd probably have to find funding for it. One problem is that this is something that most individual users don't need, and it's the individuals who keep Krita going with donations, subscriptions and sales on the Windows Store. Game and VFX companies do need this feature, but they don't seem to be in a position to club together and shell out.
jloehrlein
Registered Member
Posts
1
Karma
0
Just my two cents, but I've been looking for a photoshop alternative for years. The very first test I do when looking at a package includes seeing if it has a decent way of controlling the alpha channel. Krita looks nice, but it failed that test immediately.

FYI my standard test is to draw a white 600x600 circle exactly in the center of a 800x800 texture, with a 32 pixel black outline and save it to a file with alpha. Issues I had with Kritia in doing so include:

1) No way to select from the center of a locked size ellipse. (The origin is always the upper left corner)
2) No way to see what pixel the cursor is over. (a digital readout is needed)
3) No way to directly control the alpha channel.

I also evaluate on how easy it is to add the black outline. The more automatic the better.
User avatar
halla
KDE Developer
Posts
5092
Karma
20
OS
So, what are you going to do about that? Are you going to provide some code?


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], markhm, rblackwell, sethaaaa, Sogou [Bot], Yahoo [Bot]