
I am trying to make scenes with natural looking trees in Blender. In Blender cycles I try to bake texture images for the leaves but I cannot manage to bake the alpha.

I am trying to make scenes with natural looking trees in Blender. In Blender cycles I try to bake texture images for the leaves but I cannot manage to bake the alpha.
Start with a picture of leaves. This one I took is not the best example since I did not put the leaves on a neutral background which makes selecting the background in a 2D editor less precise. Just put the leaves on a sheet of paper when taking the picture and things should work out.
(if you have difficulty seeing detail of the images I've posted, you can right-click the picture and select View Image. It will open up to it's full size.)

Now in GIMP or preferably Krita because the selection tool is much better, select the background and flood fill this selection with black. Invert the selection so the leaves are outlined and fill them with white. You may also want to blur the mask a bit so the leaves have soft edges. This will help to hide artifacts left from the selection tool.

Now I baked the leaves using the following nodes, you can set the render samples very low for baking Emission. There should be no noise at all using 8-16 AA samples.
Remember to increase the color value of the Emission shader all the way to full white. It's default is 0.8. Set that to 1.0 instead.

This is the result I got from the bake.

And the final node setup up for the scene render, 
Update:
To separate leaves like this you can enter Edit mode with the plane selected which has the leaves all together on one sheet. This will make it easier to UV unwrap the separate leaves. So now add a bunch of planes and scale them to the size of the leaves on the image plane. Now select everything, including the plane which has the leaves already and press the 'u' key and select Project From View(bounds). The original plane will act as a container for the unwrapping algorithm and this will keep the new leaf planes proportional to the image they will be mapped to so no extra adjustments will have to be made at this stage.

Now locate the UV maps area that is shown in the following image and click the + sign to add a new UV set and give it a name that makes sense to you. Also make sure to activate it and click the camera icon at the right side. Whatever is selected here will be the image that is baked to. Now this time for Unwrapping, I used the one at the top labeled 'Unwrap' and I set the margin to '0' since the edges will be transparent and there will be no seams. There will also not be any mip-mapping issues because of the transparency if you decide to also do something like this for a game.
After they were unwrapped and the original plane was deleted, I selected all the 'leaves' and separated them using Separate p->By Loose Parts. Now return to Edit mode, select them all and use Ctrl + g to make them a group. You can now use this group in the Particle generator settings to add them all in together but still as separate pieces.

To bake the color, I used the baked texture that I showed how to make from the steps earlier. Here is what it looks like now.

And I also did the same thing for baking the black and white stencil. I just replaced the baked texture node with the stencil node from the earlier steps.

Next, I used Texture Paint mode to clean up the edges for both the newly baked textures.

I then sketched out a quick wireframe for a tree then used the Skin Modifier to fill it out. Applied the modifier and clean the mesh up a bit then added a Sub-surf modifier. Now I added a particle system set to Type:Hair and adjusted a few settings. I also used Weight Paint mode to control the leaf Density and Length. Here is the final result.

Maybe you could use a mix shader with an emission shader and a transparent shader.
In the node editor:
Factor: Use the alpha map (black and white) that you used for the leaf.
Emission shader: Use the image you just baked (no alpha).
Transparent: leave it white.
I haven't tried it but I think could work.