How to make image asset with transparent background in Android studio? (with option add image asset)

Viewed 9783

I have image with transparent background.

When i add image to resource folder, my background changes to white. (with android studio add image asset option)

enter image description here

If i put image directly to resource file, image background stays transparent.

5 Answers

You can do it easily by doing the below, BTW the gray circle is original in the image itself.

enter image description here

It will create you these

enter image description here

Select the

Icon type --- > Lagacy only

and

shape -- > none

as follow

enter image description here

Here is what is to be done in order to set the app icons generated to have transparent background

Edit the ic_launcher_background.xml file generated and set it like below:

This will remove the default background generated to be transparent color only.

Remove all the path definitions and only have the following one

<path android:fillColor="#00000000"
    android:pathData="M0,0h108v108h-108z"/>
Related