Transparent PNG image does not look beautiful

I have an image with a pretty big shadow around it and its background is transparent. I saved it as a PNG file from Photoshop and use it in ImageView via xml. This leads to the fact that the shadow has the effect of grouping and just does not look beautiful. Not too sure what to do ...

+3
source share
3 answers

Just add

// set 32 bit window (draw correctly transparent images)
getWindow().getAttributes().format = android.graphics.PixelFormat.RGBA_8888;

in onCreate (...)

http://www.curious-creature.org/2010/12/08/bitmap-quality-banding-and-dithering/

+8
source

I can’t remember how this property was used, but I think it was an ImageView.

android:dither="true" ImageView xml , .

0

I can’t remember where I read it, but somewhere on the developer's site there was this proposal for fixing the gradient strip; it can help with the shadow. Right-click the effects icon on the shadow layer and click Create Layer to create a separate layer for the shadow. Then apply the β€œAdd Noise ...” filter to the layer with the following settings:

(in case the image ever disappears, Amount: 0.5%, Uniform, Monochromatic)

0
source

Source: https://habr.com/ru/post/1762061/


All Articles