Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make the icon background of an Android app transparent?

A PNG image is to be used as the icon foreground, and the background should be completely transparent.

Using Android Studio > New Image Asset > Configure Image Asset dialog in the Asset Studio, virtually very combination of options for the background has been tried, including removing the file entirely from the path and deleting the background tags in ic_launcher.xml and ic_launcher_round.xml.

Removing the file from the path in this wizard and removing the tags from the XML files almost does the trick, but a faint black outline remains as the background (~alpha=20%). All other options for the Background Layer leave either a stark white or black background behind the foreground image when viewing the icon on the device's launcher.

Many apps manage to have a foreground only on their icons, so it is possible. What am I doing wrong here?

Update: Thank you for the quick comments! I tried both the solutions provided as answers, same result. Screen capture is uploaded as suggested.

Updating just the Legacy icon in the wizard is not sufficient, as that only changes the Legacy icon format. The newer "Adaptive" icons are required as well. Even if the background is set to a completely transparent square png, Android Studio changes it to white. If the background file is removed entirely, the wizard allows completion, but then Android Studio uses a slightly opaque black background, as shown. With respect to the uploaded image, there should be nothing behind the foreground, completely gray to in this case without any visible circle.

Screen capture from device running API 25

like image 628
apsommer Avatar asked Jun 21 '18 04:06

apsommer


2 Answers

Method 1:

if you have a png, just copy it and paste it in drawable, and refer to image name from manifest.

<application
        android:allowBackup="true"
        android:icon="@mipmap/new_image"
        android:label="@string/app_name"
        android:roundIcon="@mipmap/new_image"
        android:supportsRtl="true"
        android:theme="@style/AppTheme">

        ....
        </application>

Method 2:

Goto file > new > image asset, make sure you select a png image (with transparent background) & set background shape to none.

enter image description here

like image 194
Amir Dora. Avatar answered Oct 01 '22 02:10

Amir Dora.


First you have a background image to get transparent icon without any background image you can't get your icon transparent .

And if you look to get image transparent you simply use some photo editor.

like image 43
Mitesh Sawant Avatar answered Oct 01 '22 04:10

Mitesh Sawant