I have an image that I've put into a new layer. This image has a lot of transparent empty spaces. I have colorized the non-transparent spaces in black. The transparent parts are still transparent.

I would want to apply a gradient only on the black parts of the image/layer, leaving the transparent spaces... well... transparent.

How can I do that? Should I use masks and layers modes together?



Menu "Layer" > Transparency > Alpha to Selection THEN: Select > Invert


  • 1
    Locking the transparency of the layer in the layers dialog and then applying the gradient might be faster; it has the addtional benefit of keeping any selection you might have intact, and is also persistent. – Michael Schumacher Oct 22 '20 at 21:48
  • 1
    Alpha to selection is actually a bad solution, since the edge pixels are likely half-transparent, and so half-selected, and so half-painted again. The alpha-lock mentioned above is the only good solution. – xenoid Oct 25 '20 at 20:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.