Registered Member
|
Hi,
Is there a way to preserve the actual colors of the image when exporting it as a tga for example. I have a group with an alpha mask that I'm exporting. What I want is this. What Krita does is replace the masked out color with black I'm an environment artist, I planned to use Krita to make textures, can't say it's going too well:( I need to create textures like that on a lot of instanced, hope I can get it to work, otherwise Krita is useless for me |
KDE Developer
|
If you'd share your original .kra file then we can see what's up. Your example images are not useful by themselves because they don't show anything that could be related to the topic: "exporting with alpha". I just tested saving an image with transparent pixels to tga, and that worked fine.
|
Registered Member
|
Here's the .kra file https://www.dropbox.com/s/h14fv3z1fxgdu ... c.kra?dl=0
Edit: this should be a better example The initial problem here is that I can't manipulate the alpha channel of the whole file directly like in photoshop. I tried doing that with having a group with a mask and exporting that, but there's the problem I described. To be precise I want the alpha channel to be there, but the RGB channel to be intact ( not modified by the alpha) |
KDE Developer
|
That's curious, because if I export that file as tga, I get an image with an alpha channel: https://i.imgur.com/R1YJFzi.png
|
Registered Member
|
Yes, it should look like that when previewing, but the alpha shouldn't replace the RGB image with black.
I'm talking mainly about exporting to tga or tiff and so on, cause I think with .png the format itself doesn't allow that. The problem is I'd need the RGB image to stay intact (have green background in this case not black). It's really important for masked textures in game, they need padding so that at lower resolutions their color is preserved. In here you have the same masked image theoretically (the non masked pixels are the same), but the first has padding the second has black background. https://imgur.com/a/qkQvwaD See how the black color bleeds into the texture. I know this might be a completely foreign idea, and Krita might not work in this way, but honestly it would make an important part of what I do impossible. |
KDE Developer
|
There's no way of saving the alpha channel into a tga file without storing it into the pixel alpha channel. Once transparency is stored into the alpha channel, most image viewers will render that either as black or transparent.
If I have an image open in Krita, and add the transparency as a transparency mask and save out as TGA, then blender can see that the fully transparent parts are indeed, colored, non-black pixels with alpha set to 0. So what you are talking about is possible. It might be that there's something else happening. |
Registered Member
|
Not sure what you mean here. I'm just trying to replicate what I did in Photoshop. I just want to preserve the color data and have an alpha channel just as usual.
Now, that seems to work fine. If I just have one layer with an alpha mask, it seems to work like I wanted it in the first place, preserving the colors. That would mean I'd need to have a collapsed layer on top when saving, not elegant but might work. It seems to be a problem with Krita losing data within a group with a transparency mask. |
KDE Developer
|
Hi, so following from the thread about Epic grant, can you please explain the process to me a bit more?
- How exactly do you export your images that results in this issue? - Can you please show the screenshot of your whole Krita window, including the Layers docker, when you have this file opened? Or, even better, can you show the file? It doesn't need to be this exact file, just something to show the issue. Can be very small and with random strokes. |
Registered Member
|
Thanks, I really appreciate you trying to help,
but if what I wrote in this thread doesn't explain it (along with images) I don't know if anything will. The only this that changed is, even this doesn't work in newest Krita.
I'll file a bug report when I have the strength. |
Registered Member
|
Hello,
I'm trying to find some info about this workflow in Krita and I found this thread. I abandoned Photoshop in favor of Krita, but in this point it lacks (or I didn't find) the "Alpha Channel" editing workflow. How we use to do: One option in Photoshop is that 1- we copy the layer with the BW paint that will be Alpha; 2- Select the Alpha Channel and paste it; 3- Save in TGA (or SuperPNG addon because Photoshop suck saving PNG) and it is done. As game developer we use a lot channels as masks. For now I didn't understand how to edit alpha channel (or any other channel just to paste from a layer or whatever). I was doing a really simple mask to apply as sprites in a particle system in Unity: http://prntscr.com/qvcl3f http://prntscr.com/qvcljr The R G B channels should be white. Is there a way to fix/workaround it? Cheers. |
Registered Member
|
I am not sure what you want to get in the end I will assume you want the alpha channel as a grayscale image. To work/get the alpha channel: Right click on the layer that has the alpha information you want (could be the background if that is. Select "Split -> Split Alpha" The layer should now have an transparency mask applied. right click on the mask -> Convert -> to PaintLayer. Now export that layer as TGA, and you should have the alpha as grayscale.
Blog http://colorathis.wordpress.com, Deviantart http://ghevan.deviantart.com/
|
Registered Member
|
Hello. Thank you for your answer.
Here is an example from Gimp and Krita: http://prntscr.com/qvo38w To better understand it: - Gimp: needs to have a Group Layer (Folder) to set the whole image bellow an alpha channel. As you can see the alpha channel didn't changed the RGB channels, as expected. And it is possible to draw directly in alpha mask or even better, being able to paste on it; - Krita: I tried To do the same but as you can see alpha channel from Krita changes RGB channels, that doesn't make any sense. I can still edit easily the alpha layer, but this behaviour makes it not possible to work it; - Photoshop: just FYI, We normally have to copy a layer, select only the alpha channel (deselecting RGB channels) and paste the content. It doesn't mess with the RGB channels. Looking at all the options right now Gimp and Photoshop works; Gimp looks to be more friendly but Photoshop you can easily enable/disable the alpha channel to being able to see the whole RGB channels. BTW I've tried your suggestion but there is no Slip > Split Alpha only Split Alpha > Write as Alpha, but it doesn't work as needed above. Cheers. |
Registered Member
|
@mangojambo:
Every version of krita from 4.2.6 onwards (and probably before) can split alpha into a mask. In 4.2.8, the sequence from the layers docker is right-click -> Split Alpha -> Alpha into Mask From the menu, it's Layer -> Split -> Split Alpha -> Alpha into Mask |
KDE Developer
|
I think you're confusing a bit how it is supposed to work in Krita.
In Krita there is no easy way to affect specific channels. Before you panic, yes, there is an easy way to do what you want to do, but it doesn't really involve channels of the layer itself. Basically you have a layer that has all four channels (let's assume RGBA) with some content. You can then right-click on the layer you want to split and do: Split Alpha -> Split as Mask. (Here's the first difference: you created a group and splitted the group? It should be working too, but there is no need for that. You can add transparency mask to a layer, too). What transparency mask do: All parts that are painted in black are transparent in the result of compositing the layer with its mask. All parts painted in grey color would be as if you erased some parts of the original layer with partial transparency. To prove the fact that it is, in fact, not just editing an alpha channel of the layer, take your eraser and erase a part of the original layer: as you can see, it is not reflected on the transparency mask, because transparency mask is it's own thing. (You can have multiple transparency mask and the alpha channel of the original layer is also available for editing - not direct, but for example using erasers - all the time). Basically Split Alpha -> Split as Mask just do this: copy the content of the alpha channel of the original layer; create a transparency mask out of it; paints the alpha channel in the original layer to be opaque. From now on you should work on the transparency mask. If you want to see it in grey colors, just right-click and select "Isolate layer". When you finish, right-click on the transparency mask and select Split -> Write as Alpha. This takes the only channel from transparency mask and put it in the alpha channel of the layer parent. (Note: if you by mistake erased a part of the layer and the alpha information is now in two places: on the layer itself and on the transparency mask, just do Split Alpha -> Split to Mask again and... well, since transparency masks cannot be merged for some reason, there is a bit of manual labor involved, so try to not do that but it's of course possible to recover, but you'd need to convert them to layers, merge with the correct blending mode, maybe even use Filter -> Color to Alpha...) I wanted to also write about Erase blending mode, but it looks like it works in a way that won't be all that useful. It doesn't work like Transparency Mask with more channels: it only sees the alpha channel of the layer instead of using black to erase and white to not erase or the other way around. Hence grey layer will just erase everything. You'd need to use Filter -> Colors -> Color to Alpha first. Last tips: - don't worry about checkboxes in "Channels" part of Properties. What is going to be written to PNG is the result of compositing. To see exact values of all channels, use Color Picker - open the Tool Options and make sure there is "Sample All Layers" selected and then check the value of the alpha channel in the textbox below. - You can also see all channels of the resulting image in Channels docker. Go to Settings -> Dockers -> Channels. It always shows the composited image, not the current layer. |
Registered Member
|
This worked, Tymond, thanks! I could export it right as you can see it opened in Photoshop http://prntscr.com/qvqo0s. To make it work in Photoshop I had to save as TGA. PS is really stupid working with PNG. Unity got both right. And Gimp as well: http://prntscr.com/qvqubf (only PNG, TGA gave me an error. Odd!) So, I can make it work now, thanks again. The problem I see for my workflow is it work for only one layer image, since the alpha is in the layer and I can't set it for a group layer. Well, or I can and don't know how! "Alpha into Mask" and "Write to Alpha" are disabled for Group Layers. Oh, another thing is the Channels are showing wrongly the output. This is the same image as above: http://prntscr.com/qvqsu0. It shows as if there was a huge black in RGB, but it doesn't. I guess it is a bug. BTW, since I'm here Channels are not updating in real time. |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot]