gpt4 book ai didi

android - Android 中的颜色深度

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:58:42 25 4
gpt4 key购买 nike

我刚刚在 samsung galaxy 10.2 上显示了位图。该图像是在 photoshop 中创建的,显示出从浅红色到略微深红色的一些细微变化,它在我的 PC 上看起来很完美,但平板电脑上的渲染显示 multiple bands .

我知道这可能是由于颜色深度不足引起的...但我不知道 android 设备的颜色深度是多少。 android甚至指定最小颜色深度吗?您可以在运行时或多或少地请求颜色深度吗?是否仅取决于设备制造商?

enter image description here

最佳答案

这是一个完美的阅读:Bitmap quality, banding and dithering罗曼盖伊。

回答您的问题:

Does android even specify a minimum colour depth?

Android < 2.3 默认加载 16 位颜色深度的位图。 Android >= 2.3 默认加载 32 位位图。引用给定文章中的 Romain Guy:

A much better solution is simply to render 32 bits bitmaps on 32 bits surfaces, which Android 2.3 now does by default.

位图的最小值为 8 位,Bitmap.Config.ALPHA_8 , 但在 99% 上你不应该使用它,而是 Bitmap.Config.ARGB_8888 .

设置您的 Window到 32 位 (Bitmap.Config.ARGB_8888) 并使用 32 位 (PixelFormat.RGBA_8888) 解码您的位图。如何操作,如下所示。

Is the colour depth something you can request more or less of at runtime? Is it just up to the manufacturer of the device?

您可以在运行时随时设置 WindowBitmap 的颜色深度。

关于android - Android 中的颜色深度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21050649/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com