Is there a way to make custom coffee foam?
It's not extremely good, but this should give you a good place to start:



The image you want to appear on the foam is very detailed and hard to reproduce on real coffee. This is why I thought it should be pre-processed in some image editing software to make it more realistic and doable. I used Photoshop to smudge out the image a bit, and I got this:


The coffee itself that I made in Blender was a simple squeezed sphere. I then used the image above as a texture to determine the color of the foam. Here is my node setup for the foam:

I'll go into the details now.

Distorting the image

I used a Wave texture to distort the image in rings. You can adjust the frequency and amplitude of the distortions.


Some noise texture on top of that

I added some noise to the image, because nocoffee is perfect.


Bump map

I didn't have any actual coffee to look at, but I'm assuming that the image should have some effect on the bumps in the foam, due to stirring. So I created some "ripple" bumps around the borders of the texture (kinda):


The coffee shader

Now, we have calculated both the texture we want on the coffee and the bump map. I used a gradient to get the right coffee colors. The actual shader was a simple mix of a diffuse shader and a glossy shader:


Here is my resulting .blend file you can play with:



Here are some possible improvements you could consider:
- It is very easy to adjust how much you want the image to be distorted in rings. In the "Distort Image" frame, just change the second value of the Divide math node.
- Consider introducing a subsurface scattering component, because coffee is transparent. Or, even better, use a volume shader. Coffee is a little bit transparent.
- You could change the colors to make them a little warmer, because my coffee looks like mud. Yuck. :)
- You could further tweak the original image: smudge it, adjust contrast, add noise, etc.