透明 PNG 图像看起来不太好看
我有一个图像,其周围有相当大的阴影,并且其背景是透明的。我已将其从 Photoshop 保存为 PNG 文件,并通过 xml 在 ImageView 中使用它。这会导致阴影产生条带效果,看起来不太好。不太确定该怎么办...
I have an image that has a fairly large shadow around it and its background is transparent. I have saved it as a PNG file from photoshop and am using it in an ImageView through xml. This results in the shadow having a banding effect and just doesn't look nice. Not too sure what to do...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
只需添加
onCreate(...)
http://www. curly-creature.org/2010/12/08/bitmap-quality-banding-and-dithering/
Just add
in onCreate(...)
http://www.curious-creature.org/2010/12/08/bitmap-quality-banding-and-dithering/
我不记得这个属性是用来做什么的,但我认为它是一个 ImageView。
尝试使用
android:dither="true"
作为 ImageView xml 声明的一部分,看看是否有帮助。I can't remember what this property was used on, but I think it was an ImageView.
Try using
android:dither="true"
as part of the ImageView xml declaration and see if that helps.我不记得在哪里读过它,但在开发者网站上的某个地方有这个修复渐变带的建议;它也可能对阴影有帮助。右键单击有阴影的图层上的效果图标,然后单击“创建图层”为阴影创建一个单独的图层。然后使用以下设置将“添加杂色...”过滤器应用到图层:
(以防图像消失,数量:0.5%,均匀,单色)
I can't remember where I read it, but on the developer site somewhere there was this suggestion for fixing gradient banding; it might help with the shadow as well. Right click the effects icon on the layer that has the shadow, and click "Create Layer" to make a separate layer for the shadow. Then apply an "Add Noise..." filter to the layer with the following settings:
(in case the image ever disappears, Amount:0.5%, Uniform, Monochromatic)