Color dithering in Android

Is it possible to disable the color dithering that takes place when rendering an ABGR8888 texture onto a RGB565 target (Android GLES)? I’m repetitively copying between the renderer target and the texture (using SDL_RenderReadPixels and SDL_RenderCopy) and this is causing the dithering to be magnified until it becomes very visible. Using the nearest solid color would presumably solve this problem.

I initially thought I would simply have to choose my 24-bit colors so that only the top 5-bits of the components were non-zero, but that didn’t work - they were still dithered. If there is some magic in determining which colors will be dithered and which won’t that would be an alternative solution.

Richard.

If you can call GLES functions directly, try glDisable(GL_DITHER).On 20/05/2016 19:28, rtrussell wrote:

Is it possible to disable the color dithering that takes place when
rendering an ABGR8888 texture onto a RGB565 target (Android GLES)? I’m
repetitively copying between the renderer target and the texture
(using SDL_RenderReadPixels and SDL_RenderCopy) and this is causing
the dithering to be magnified until it becomes very visible. Using the
nearest solid color would presumably solve this problem.

I initially thought I would simply have to choose my 24-bit colors so
that only the top 5-bits of the components were non-zero, but that
didn’t work - they were still dithered. If there is some magic in
determining which colors will be dithered and which won’t that would
be an alternative solution.

Richard.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

SiPlus wrote:

If you can call GLES functions directly, try glDisable(GL_DITHER).

Yes, thanks, I also found that myself and indeed it does exactly what I want.

Richard.