When we create an application its very easy to display user image or profile pic. when no image is available then we used to include an anonymous image in place of no image is available. But Gone were days and now we have something rich and interactive UI option. Now we have option that we can display a person's name initials as an image to identify that person. It seems interesting for developers and impressive for users.
we pass the name of the user in this function so that initials can be found out. In getinitials function we create a canvas and give some style to it. then split the name and get initials and return the data from the function to display initials as an image in user interface.