Converting Black and White to Black and Transparent

Note: this tutorial is for people that, like me, just need a point in the right direction so that they can say “of course, why didn’t I think of that”. If you want a more in-depth tutorial by someone who isn’t writing frantically inorder to finish the post before finishing work for the day then check out this guy – it’s written for Photoshop Elements but is still relevent.

The problem
You have an image that is black lines on a white background[1] and you want to convert it to black lines on a transparent background. I have found a couple of ways to do this.

Solution 1 – Blending options.
This method is simple and quick.
First, right click on the layer you wish to use and click “blending options”. You should see something like this:

The section we’re interested in is the “Blend If” section, specifically the white pointer(s) indicated by the red arrow. (By default there is only one arrow rather than two in the image above. Be patient, we’ll get to this!) This represent the darkness of your image as grey-scale (unless you choose a colour from the drop down). Any pixels brighter than the value selected will be made fully transparent.

The first thing you will notice is that this doesn’t look very nice. Some pixels are transparent and some aren’t – there is no in between! So we need to blur the line between transparent and opaque. To do this we hold ALT and drag the pointer again. This time you will only drag one half of the pointer. The further these two are apart, the softer the difference between transparent and opaque. If you are working on a black and white image you probably want one half of the pointer all the way to the left and one half all the way to the right. This should result in pure white being pure transparent, pure black being pure black and 50% grey being 50% transparent.


Solution 2 – Layer Masks

The previous method is quick and easy but is fairly limited. A better way might be to use layer masks. If you haven’t used layer masks before then take your hand and give yourself a slap for being such a fool! You’re not only missing out the massive potential they offer but probably doing things the long and tedious way because you don’t know any better!

A quick explanation of masks
When you are editing in Photoshop the chances are you are using three channels – Red, Green and Blue (unless you’re using CMYK in which case it’s four – Cyan, Magenta, Yellow and blacK). Each of these can be represented as a greyscale image. If you open the “channels” panel (usually in the same box as the layers panel) you should see what I mean. For example if you draw some pure red this will show up as white on the red channel and black on the other channels. It is the combination of different levels of these channels that defines the colour.

A mask is another channel which, instead of influencing the hue, alters the opacity – so white is opaque and black is transparent. Like so:

The above image is composed of one layer with a rainbow coloured fill which covers the whole image. You can see here how the red, green and blue channels form the final colours. There is also a alpha channel (called layer 1 Mask) which controls the opacity of the layer. As you can see the lower half of the mask is coloured white and is therefore visible.

Using masks for the topic in hand

Invert your image.
Select your whole image.
Copy it.
Create a new document the same size as your image.
Fill the entire document in black.
Create a mask for the layer. (Do this by clicking the icon at the bottom of the layers panel which looks like a grey square with a white circle in it)
You should now see two previews instead of one in the layer panel. The one on the left is the image. The one on the right is the mask. This should be white meaning that the whole image is visible.
Hold ALT and click on this mask preview in the layer window to edit the mask.
Paste your image.
ALT-click the layer again to exit mask editing.

Your inverted image should now be working as a mask meaning that the bits in your image that were white (after inversion – i.e. the lines) will be shown as black and the rest of the image will be transparent.

Changing the colour of the layer (not the mask!) will change the colour of the lines.

Note: you can edit the mask by using the brush, fill or eraser tools without entering mask edit mode. This enables you to change the mask while previewing the result rather than flicking between the mask and the result.


Photoshop is awesome!

[1] This will work with colour images too but I’ll try to keep it simple. You can use these techniques for all do sorts of advanced tricks.


About Mr Chimp

I make music, draw pictures, browse the internet, programme, and make sweet, sweet cups of tea until the early hours.
This entry was posted in Uncategorized and tagged , , . Bookmark the permalink.

2 Responses to Converting Black and White to Black and Transparent

  1. Mahdi says:

    HERE IS THE EXACT SOLUTION by using Photoshop

    Follow these steps :

    1.Open your grayscale image
    2.Flatten Image
    3.Duplicate the background layar
    4.Invert the background layar
    5.Select all the background layar and copy that

    now we should use this copy as a mask for the Duplicated layar…

    6.Select dupclicated and on the small layar window and click on the layar mask bottom
    7.The created mask will appear beside the small layar image in the layar window
    8.The mask is completly white, and you should paste the copy into mask
    9.By holding the ALT key and one click on the mask the mask will be show in the main window instead of your selected layar
    10.Then you should paste here holding ALT key again and clickicking on the layar icon you will go back to the main layar.
    12.Delete the background layar and you will find yor file as transparent image
    13.For applying the mask to the layar u shold right click on created mask icon and select Apply mask to layar select Apply.

    I hope you enjoy…

  2. Alexey says:

    Thank you, Chimp! That was really useful.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s