Make Image Transparent in Blender
Make your paper drawing or photo transparent for use in 2D or 3D animation
This can be done in several ways. The method discussed here work best for high contrast images with distinct contours, like black drawing on white paper or a solid shape against an even coloured background. The example down below shows a greyblack pencil drawing on white paper . (Tips for more complex backgrounds will be added later. Info on how to make a texture in a material transparent in Blender will also be added later but you can say it starts with having an image with some parts transparent, that is an alpha layer.)
Turn your image transparent in Blender
Open Blender. You can choose the default General setup.
On the top Menu, click Compositing.
First check your settings.
To know where your exported images will end up and in what shape, you should check the Output Properties.
You'll find it to the right, there are many small buttons, you should choose the one that looks like a printer.
Format, make the resolution as you want, suggested about as large as your images are in this case. (Or you will end up with a black frame around the images.) If your images are in odd format, consider first adding them as an overlay to a white image of a standard resolution and render them as a sequence, after that open them again and continue with making them transparent.
Frame Range, set frames to be as many as your image sequence is, if you have 100 images, set to End on 100.
Output Choose the output path, keep the default File Format PNG so you will get an Image Sequence (and not a video).
Now you are ready to import your images as a sequence.
At the top, to the right, check the little box "Use Nodes". A couple of Nodes will then be created on a "black board". (You can click on the Render Layers node and click on Delete, we don't need it now.)
From same place, choose Add - Input - Image Sequence
Look for the folder where your images are located.
Note: It is a good idea to name your image files with sequence numbers at the end of the file name if you need to keep the images in order. Such as …001.png, …002.png, …003.png.
Select all the images.
Back in Blender compositing "black board" area, you will now have a node containing all your images. Left click to place it somewhere on the "black board".
Note: If you don't see it, watch where your mouse pointer is, the node may float around with your mouse pointer until you left click to place it.
Add a Viewer to be able to see the images.
Add - Output - Viewer
Connect the yellow Image output from the Sequencer node to Image Input on the Viewer node, by click and dragging from the output to the input. A little yellow "wire" now connects the two nodes.
Later on you will do the same with the Composite node, drag from the Image output node to the Composite node. Connecting the Viewer node only means that you will be able to see what you are doing, the actual changes will render and export from the Composite node. Make sure "Use Alpha" is checked in both the Viewer and Composite nodes.
You can move your nodes as you please by dragging them.
Now you should be able to view the first image in the background. (If not, you can make an Image Editor window and select to show Viewer.)
Turn your images transparent.
From Add - Converter - ColorRamp
Plug in the connection from the Image Sequencer node to the input on the ColorRamp node (called Fac).
The ColorRamp converter is similar to using Levels in Gimp, you adjust contrast and dark and bright levels. So in this example case we need to raise the black in the Stickman image. (It's a thin grey pencil drawing.) You may not need this in your images, or your values will need to be different.
Again from Add - Matte - Color Key
Plug in Color Ramp Image Output into Color Key Image Socket.
Leave the color as pure white for now. If your drawing or image has a different background color, you would set it to that color and skip the ColorRamp and perhaps try Chroma Key or Keying node instead of Color Key, but for this example we assume it is a black and white drawing.
Plug in Color Ramp Image Output into Color Key Image Socket
Now plug in Color Key Image Output both into Viewer Image Socket AND into Composite Image Socket.
To remove the white background, adjust V, values on Color Key. (If it was another colour you could try adjust the H and S (hue and saturation) values too.
Try to raise the black color stop (the lower "arrow") on Color Ramp by dragging it towards the white. This may help increase contrast and make your image stand out more.
Now you probably need to adjust Values on Color Key again.
Experiment with these values on ColorRamp and Color Key nodes until it fits your image.
Zoom in and out on the image to check for best results.
To export your image sequence, click on Render from the menu on the top right and choose Render Animation (if you choose Render Image you will only get one Image.)