You may have already found the answer to this question, but only for those who are still looking for the answer, here it is.
JPEG clearly provides much better compression and smaller image size than PNG. A small size is desirable for optimizing transactions over the network, storage and uploading images. However, when you save the view in JPEG format, the transparent background defaults to black. Therefore, if you want it to be any other color (including white), you must set the background for the representation of this color using the following code in the XML of your layout.
android:background="@color/whiteColor"
And you should define your color in colors.xml as below
<color name="whiteColor">#FFFFFF</color>
This should help you achieve your desired compression along with your desired visual effects. All the best...
source share