Gimp-Forum.net
Semi-transparent background with a gradient. - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: General questions (https://www.gimp-forum.net/Forum-General-questions)
+--- Thread: Semi-transparent background with a gradient. (/Thread-Semi-transparent-background-with-a-gradient)

Pages: 1 2


Semi-transparent background with a gradient. - Mixxer - 04-07-2021

Hi

I have a semi-transparent background with a black gradient circle in the middle. The circle is solid in the middle and gets more transparent as it goes towards the edges. How do I make the background totally transparent without loosing the gradient soft edges? Cutting around won't work. I tried the magic wander but it for some reason selects the whole image. Thanks


RE: Semi-transparent background with a gradient. - Ofnuts - 04-07-2021

(04-07-2021, 08:35 AM)Mixxer Wrote: Hi

I have a semi-transparent background with a black gradient circle in the middle. The circle is solid in the middle and gets more transparent as it goes towards the edges. How do I make the background totally transparent without loosing the gradient soft edges? Cutting around won't work. I tried the magic wander but it for some reason selects the whole image. Thanks

You have to edit the alpha channel, which is done by editing the mask:
  • Layer ➤ Mask ➤ Add layer mask and initialize to "Transfer layer's alpha channel"
  • Start the Levels tool (which will apply to the mask)
  • The histogram is likely not reaching the left edge, so just drag the black-point handle to the beginning of the histogram curve to make the least opaque bit fully transparent.
  • You can also play wit the middle handle to adjust how the opacity is reduced.
[attachment=5840]

  • Once happy with the result you an apply the mask Layer ➤ Mask ➤ Apply layer mask, but you can also keep the mask around.

You can have even more control with the Curves tools (where you can completely "shape" the opacity change...)


RE: Semi-transparent background with a gradient. - Mixxer - 04-07-2021

Thanks for the reply.

Unfortunately I couldn't get it to work. For starters, my levels panel looks different. I see no histogram. I would post a screen capture but I can't find how.


RE: Semi-transparent background with a gradient. - Ofnuts - 04-07-2021

(04-07-2021, 10:18 AM)Mixxer Wrote: I would post a screen capture but I can't find how.

The "Attachments" link at the top right of this page tells you everything....


RE: Semi-transparent background with a gradient. - Mixxer - 04-07-2021

Ok, thanks. Here is how I see my levels panel:

[Image: levels.jpg]


RE: Semi-transparent background with a gradient. - Ofnuts - 04-07-2021

OK Given the histogram there is tiny bit which is completely opaque (the small bar at X=255) while the rest of the layer is uniformly partially transparent (the tall bar around X=192). In the Layers preview the mask must mostly appear light gray with a small white area, and there is no opacity gradient in your image. So either your initial description isn't correct or you didn't create the layer mask properly.

Nevertheless if the layer is uniformly partially transparent you can create an opacity gradient by using the Blend tool (likely in Radial shape) to create a gradient from white (where things are fully opaque) to black (where things must be fully transparent).

Otherwise please attach a screenshot of your layers list.


RE: Semi-transparent background with a gradient. - Mixxer - 04-08-2021

Indeed, in the Layers preview the mask appears light gray and the shadow in the middle is white.

There is indeed a gradient. You can actually see the edge of it on the Levels Panel screen capture top right. In that case it is not a circle.

I had some success with the Curves. But it is difficult to gauge when it is 100% transparent. And it also seems to eat into the soft edges. If I go far enough, I can actually make the edges smaller to the point where the soft edges are gone and the shadow becomes smaller, showing only the solid middle. The Levels would be easier as you can't drag it past 0, so I would know it is fully transparent, without overshooting.

By the way, how can you tell the semi transparent bar is at X=192? I don't see any numeric indication of that on that panel. Smile


RE: Semi-transparent background with a gradient. - rich2005 - 04-08-2021

Quote:...I had some success with the Curves. But it is difficult to gauge when it is 100% transparent.

You can use sample points to show the colour values at specific points as you adjust the image. https://docs.gimp.org/2.10/en/gimp-sample-point-dialog.html

Quote: ...it also seems to eat into the soft edges. If I go far enough, I can actually make the edges smaller to the point where the soft edges are gone..

Indeed a problem. It would have helped if you gave information about this semi-transparent BG. Plain colour or... what?
This using a 50% transparent background with a black circular gradient planted on top. Using Colour-to-Alpha for the adjustment with sample points.
3 minutes duration https://youtu.be/D3cyiKLq9oM


RE: Semi-transparent background with a gradient. - Ofnuts - 04-08-2021

(04-08-2021, 10:35 AM)rich2005 Wrote: You can use sample points to show the colour values at specific points as you adjust the image.  https://docs.gimp.org/2.10/en/gimp-sample-point-dialog.html
And the very useful Pointer dialog...


RE: Semi-transparent background with a gradient. - Ofnuts - 04-08-2021

(04-08-2021, 07:01 AM)Mixxer Wrote: By the way, how can you tell the semi transparent bar is at  X=192? I don't see any numeric indication of that on that panel. Smile

I aligned my Levels dialog over your screenshot to get an estimate, then 192=128+64 so in hex it's xC0, in other words a round number Smile