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.

98 questions
38
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,313
  • 2
  • 25
  • 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…
13
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,935
  • 5
  • 50
  • 70
13
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
  • 12,078
  • 7
  • 45
  • 64
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
8
votes
4 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
  • 3,677
  • 3
  • 28
  • 32
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
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,722
  • 3
  • 37
  • 48
6
votes
1 answer

Floyd Steinberg dithering in GraphicsMagic or ImageMagic

I'm having trouble converting images to 1bit dithered images using GraphicsMagic. The converted images are to be used as input for a thermal printer. I'm using the following command: gm convert input.jpg -resize 384 -monochrome -dither out.bmp The…
Woozer
  • 73
  • 1
  • 6
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,450
  • 1
  • 19
  • 31
5
votes
1 answer

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
  • 131
  • 3
  • 10
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
  • 17,359
  • 16
  • 83
  • 116
5
votes
5 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
5
votes
1 answer

PIL - Dithering desired, but restricting color palette causes problems

I am new to Python, and trying to use PIL to perform a parsing task I need for an Arduino project. This question pertains to the Image.convert() method and the options for color palettes, dithering etc. I've got some hardware capable of displaying…
nivek
  • 515
  • 1
  • 7
  • 18
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
  • 2
1
2 3 4 5 6 7