Questions tagged [dithering]

Dither is an intentionally applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images.

Dither is an intentionally applied form of noise used to randomize quantization error, preventing large-scale patterns such as color banding in images. Dither is routinely used in processing of both digital audio and digital video data, and is often one of the last analog stages of audio production to compact disc.

A typical use of dither is: given an image in grey-scale, convert it to black and white, such that the density of black dots in the new image approximates the average level of grey in the original image.

Dithering is also used in image processing, typically consisting of alternating pixel colours to create the illusion of a new colour.

80 questions
37
votes
1 answer

How to draw a smooth/dithered gradient on a canvas in Android

Several answers mention to use GradientDrawable.setDither(true) to draw smooth gradients in Android. That has no effect in my code. Any idea what I have to change to get a well looking gradient in my live wallpaper? GradientDrawable gradient = new…
André
  • 2,225
  • 2
  • 24
  • 29
13
votes
2 answers

Color banding only on Android 4.0+

On emulators running Android 4.0 or 4.0.3, I am seeing horrible colour banding which I can't seem to get rid of. On every other Android version I have tested, gradients look smooth. I have a SurfaceView which is configured as RGBX_8888, and the…
12
votes
2 answers

monochrome dithering in JavaScript (Bayer, Atkinson, Floyd–Steinberg)

I'm playing with webcam filters in HTML5. Got an Atkinson dither working pretty well for that old-school Mac feeling. Live | Code Now I'm trying to make a Bayer ordered dithering option for a 1989 Gameboy feeling. I read up on the algorithm, but…
forresto
  • 10,895
  • 6
  • 41
  • 62
11
votes
2 answers

Floyd–Steinberg dithering alternatives for pixel shader

I know that Floyd–Steinberg dithering algorithm can't be implemented with pixel shader, because that algorithm is strictly sequential. But maybe there exist some higly parallel dithering algorithm which by it's visual output is similar to…
Agnius Vasiliauskas
  • 10,413
  • 5
  • 46
  • 66
8
votes
1 answer

How can you load a matrix in from a file in octave?

I loaded an 8bit grayscale image into octave with imread, then I saved it in ascii format and got a giant list of all of it's values. Then I dithered it with a 2x2 matrix in Java and printed out a list of each dithered matrix all on one line. If the…
zak
  • 81
  • 1
  • 1
  • 2
7
votes
1 answer

Converting RGB image to Floyd-Steinberg image using PHP or Javascript for Zebra printers

I am developing a desktop based PHP application where we need to capture image of a person and print it on the label using Zebra GC420t printer The expected image should look like below image. When I try to print the it gives the output like below…
7
votes
3 answers

What is a good, optimized C/C++ algorithm for converting a 24-bit bitmap to 16-bit with dithering?

I've been looking for an optimized (i.e., quick) algorithm that converts a 24-bit RGB bitmap to a 16-bit (RGB565) bitmap using dithering. I'm looking for something in C/C++ where I can actually control how the dithering is applied. GDI+ seems to…
JacobJ
  • 2,887
  • 3
  • 25
  • 31
6
votes
2 answers

How to discern which color is "lower" and/or "higher" in CIE-L*a*b* colorspace for ordered dithering?

I have implemented several functions to convert sRGB to the CIE-L*a*b* color space. Now, I'd like to use that for dithering, but I'm unsure how to exactly discern which color is the "lower" color, and which one is the "higher" color. When dithering…
polemon
  • 4,256
  • 2
  • 31
  • 45
5
votes
3 answers

Best quality dithering library in C

I'm developing a texture atlas packer to use with OpenGL, and I'm currently looking for an open-source (it's better if it's a library, but an open-source software would be good as well!) solution that will render the best results for color palette…
Waneck
  • 2,340
  • 15
  • 30
5
votes
0 answers

Is this a correct implementation of ordered dithering?

I am interested in dithering, ordered dithering to be more precise. I spent many hours on researching and experimenting. And hope that after all the effort my code works as it should. I am going to provide my code that does the dithering, and some…
Marat Isaw
  • 129
  • 1
  • 7
5
votes
2 answers

Image Resize Aliasing in WPF v4 but not under v3.5

I am using WPF for an image resizing pipeline which has been working beautifully under .NET v3.5. I just upgraded the project to target v4.0 and now all of my resized images are heavily aliased. None of the image pipeline code has changed. Has a…
mckamey
  • 16,875
  • 15
  • 76
  • 114
5
votes
4 answers

Fastest dithering / halftoning library in C

I'm developing a custom thin-client server that serves rendered webpages to its clients. Server is running on multicore Linux box, with Webkit providing the html rendering engine. The only problem is the fact that clients display is limited with a…
Luka Birsa
4
votes
9 answers

2-color dithering

I have an array of containing a mixture of 0s and 1s. I want to rearrange the contents of the array so that as many even positions in the array contain 0 and odd positions contain 1 as possible, subject to the constraint that the number of 0s and 1s…
Sunny
  • 57
  • 1
4
votes
3 answers

Bayer Ordered Dithering

I'm updating a plugin for Paint.net which i made some months ago, it's called Simulate Color Depth and it reduces the number of colors in the image to the chosen BPP and for a long time it have had dithering included but NEVER ordered dithering and…
Cookies.net
  • 69
  • 1
  • 1
  • 5
4
votes
1 answer

Converting between 24bit RGB and 8bit colors

I'm trying to convert 24bit (8R, 8G, 8B) into 8bit (RRRGGGBB) colors I understand the basic concept of scaling the color bytes down and adding them together (after shifting). i.e. given RGB(255,254,253) I would take 255/32*32 + 254/32*4 + 253/64 and…
Vbomm
  • 43
  • 5
1
2 3 4 5 6