Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
save image with mask layer to file with transparency
#1
How? Seems like something that should be straight forward.

Answering my own question here.

mask -> active layer
right click menu -> Mask to Selection
delete mask layer
image -> active layer
fill selection with key color
colors -> color to alpha [select key color]
file -> export as png

Is there a way to do this directly, without the step using color to alpha?
It would be nice if it could all be accomplished in one step.
Reply
#2
(01-24-2021, 02:36 AM)bitrat Wrote: ...

Maybe I'll try some script-fu.
Reply
#3
I can't wrap my head around what you are trying to do but it looks way too complicated anyway. If you use a layer mask (which you don't seem to be doing) you would skip most of this.
Reply
#4
(01-24-2021, 08:57 PM)Ofnuts Wrote: I can't wrap my head around what you are trying to do but it looks way too complicated anyway. If you use a layer mask (which you don't seem to be doing) you would skip most of this.

I am using a layer mask. That's fine inside GIMP using the native .xcf format, but I want to export a .png file with transparency, with the alpha channel matching the mask.

This seems so obvious and basic I can't believe it's not a built in command. Maybe it is, but I haven't found it.
Reply
#5
(01-24-2021, 09:06 PM)bitrat Wrote:
(01-24-2021, 08:57 PM)Ofnuts Wrote: I can't wrap my head around what you are trying to do but it looks way too complicated anyway. If you use a layer mask (which you don't seem to be doing) you would skip most of this.

I am using a layer mask.  That's fine inside GIMP using the native .xcf format, but I want to export a .png file with transparency, with the alpha channel matching the mask.

This seems so obvious and basic I can't believe it's not a built in command.  Maybe it is, but I haven't found it.

That works for me. If I export the attached XCF to PNG, I get the expected result. Maybe you have to force the pixel format in the PNG dialog.

   


Attached Files
.xcf   Masked.xcf (Size: 15.01 KB / Downloads: 128)
Reply
#6
Hmm, thanks! Yes that works. I was doing the layer mask wrong, so a big help all round! :-)
Reply


Forum Jump: