I want to show 3D embossed look and feel as shown in following image. I used EmbossMaskFilter but cannot get it to show the effect (see code below). Is there a different way to
If you're not afraid of dabbling into some low-level image processing, you can use convolution matrices to achieve an emboss effect. You could use your image's silhouette (i.e. the alpha channel) as an input to the filter. For example, if you use this 5x5 matrix:
| -2 0 0 0 0 |
| 0 -1 0 0 0 |
| 0 0 n 0 0 | * (1/n)
| 0 0 0 1 0 |
| 0 0 0 0 2 |
and apply it to such image (representing an alpha channel):
you'll get this effect:
All of the computed values have been decreased by 127 to ensure that they will be in range of 0-255. I used n = 10
in this particular example. You can manipulate the radius by using a matrix of different size (it's not hard to extrapolate) and the depth by adjusting the value of n
(the bigger the value, the subtler the effect).
Given the original alpha channel, and the computed mask you can determine offsets to apply to the respective pixels of the original image, thus creating an emboss effect.
Hope that helps.