Jump to content

Create an alpha mask from a semi-transparent object


Go to solution Solved by frio,

Recommended Posts

Hi, I'm rather noobish at image editing. 

I just recently learned about alpha masks and how to use them to make an item transparent. I use BoltBait's plugin pack - the Apply mask function for that. 

Problem is, I have an image with something that's semi-transparent. (it's some lights with a black background) and I'm trying to figure out how to make it transparent. Magic wand won't help because the lights are somewhat transparent, meaning they have some black background with em, and they fade off as the light travels further. 

 

I was told by someone to make the image monochrome, then invert, and use that as a mask, but for some reason the lights come out really really dim, and it isn't really usable. 

 

I've attached what I got.

 

Here's the original image.

 

image.png.41ca5c9ef3b27bd7666db73c2a7e8797.png

this is the mask I generated

image.png.a2a98fe3de7b59471e50abe9ee14efd2.png

and this is the result I get when trying to use that as an alpha mask:

image.png.c303620203b8b8b5adeb9cb8a69498c4.png

 

I'm definitely doing something wrong here. 

I'd appreciate the help as I'm getting sick of using chroma key (due to the lack of transparency and AA-support) and would love to use alpha masks more frequently once I've gotten them down.

 

Link to comment
Share on other sites

  • Solution

Try Make Color Transparent from KrisVDM's pack. Choose black as the color to make transparent, 0.8 power, 0.0 full transparency threshold.

 

image.png.3b454404f5420246b6c90fc154f82f3f.png

The reason you get dim colors from using an alpha mask is because the colors themselves are already "tainted" by the black background, and applying an alpha mask won't remove that blackness in them, which brings up an alternative solution: using Curves+ from pyrochild's plugin pack.

 

First grab the grayscale version of your picture to use for an alpha mask, then use Curves+ in HSV mode on the original. Uncheck "hue" and "saturation", and crank the only remaining curve (value) into a straight horizontal line at the top, i.e. you remove all value differences by maxing value out. Then apply the grayscale alpha mask on this value-removed image.

  • Like 1
Link to comment
Share on other sites

2 hours ago, frio said:

The reason you get dim colors from using an alpha mask is because the colors themselves are already "tainted" by the black background, and applying an alpha mask won't remove that blackness in them

That makes sense. 

I gave the Make Color Transparent plugin a try and it seems to work a bit better, although the colors are a little dim. I duplicated the result a few times and got a decentish result. 

With the alpha matte the result included some black so duplicating it would just make the colors darker, whilst here it doesn't have black, so it works. 

 

image.png.121e03365dec4d3f82fedf9e3179f1ca.pngimage.png.fd656a6d99cfb2ea4b5c1503730f33ee.png

 

2 hours ago, frio said:

First grab the grayscale version of your picture to use for an alpha mask, then use Curves+ in HSV mode on the original. Uncheck "hue" and "saturation", and crank the only remaining curve (value) into a straight horizontal line at the top, i.e. you remove all value differences by maxing value out. Then apply the grayscale alpha mask on this value-removed image.

I tried this, but it didn't work - the mask just caused the lights to have that black background and is similar to a greyscale image that was overexposed, or a magic wand.

 

image.png.77df2c7ad01269f6c43e59f6cf076329.pngimage.png.f4acd95df98008eb99267f7b87837d6e.png

 

Thanks for the help man. 

It's a little annoying I have to do this kind of thing because the software where this image comes from doesn't support transparency...

  • Like 1
Link to comment
Share on other sites

26 minutes ago, ChrisTCC said:

I tried this, but it didn't work - the mask just caused the lights to have that black background and is similar to a greyscale image that was overexposed, or a magic wand.

 

I may have explained that poorly since I got kinda similar results as make color transparent, but as long as you found a resonably working solution it's all good.

  • Like 1
Link to comment
Share on other sites

1 hour ago, Pixey said:

@ChrisTCC if you duplicate & merge a couple of times, this image will look stronger.

it doesn't work for the specific image you quoted, as it still includes some black. 

 

I did successfuly do that here though:

11 hours ago, ChrisTCC said:

With the alpha matte the result included some black so duplicating it would just make the colors darker, whilst here it doesn't have black, so it works. 

 

image.png.121e03365dec4d3f82fedf9e3179f1ca.pngimage.png.fd656a6d99cfb2ea4b5c1503730f33ee.png

 

Thanks though.

  • Thanks 1
Link to comment
Share on other sites

20 hours ago, ChrisTCC said:

I duplicated the result a few times and got a decentish result. 

 

Duplicate the layer & set the top layer blend mode to Multiply. Merge down. Repeat.

 

Multiply-Colors.png

Link to comment
Share on other sites

3 hours ago, Ego Eram Reputo said:

Duplicate the layer & set the top layer blend mode to Multiply. Merge down. Repeat.

 

What does the blend mode "multiply" do?
Duplicating the result got me a decent result, but the one you posted is a little darker than the original. 

Link to comment
Share on other sites

31 minutes ago, Tactilis said:


It's always worth checking to see whether the paint.net Documentation can help.

See 'Layers | Blend Modes'  https://www.getpaint.net/doc/latest/BlendModes.html
 

right, I'm being stupid, Thanks for the link.

 

I believe multiply is a little overkill for this case, but I'll give it a shot in the future, thanks for the heads up.

  • Like 1
Link to comment
Share on other sites

4 hours ago, ChrisTCC said:

I believe multiply is a little overkill for this case

 

After you set the layer to multiply, before you merge down, you can always change (lower) the opacity of the layer to something you like. (it will be less dark).

  • Like 1
Link to comment
Share on other sites

1 hour ago, lynxster4 said:

 

After you set the layer to multiply, before you merge down, you can always change (lower) the opacity of the layer to something you like. (it will be less dark).

I guess that works, but for this case layer on the normal mode is sufficient because the colors are that faint in the first place.

Still, good to know that this is also an option.

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...