News for hackers. Stuff that matters.
Re:Image Dithering: Eleven Algorithms and Source Code by dahart on Friday October 06, 2017 @12:21AM (#15414399)
Yep, Photoshop does dithering by default when converting from 16bpp (or higher) to 8bpp. Many, many image processing apps & libraries don't do this, and I wish they would!

This is a little different than the article though -- all the article's dithers are good at half-toning, or 1bpp images. If your destination is 16bpp images, or 16-bit audio, you don't need error diffusion, just a decent sequence of random numbers.

Re:Image Dithering: Eleven Algorithms and Source Code by colejohnson66 on Friday October 06, 2017 @08:52AM (#15416388)
Why does one need dithering to go from 16-bit to 8-bit? Can’t I just shift the value to the right by 8 bits?
Re:Image Dithering: Eleven Algorithms and Source Code by dahart on Friday October 06, 2017 @09:49AM (#15416734)
Just to add to what @grenoire said -- if you only shift/truncate then there are times when can see (or hear) the difference between 1 bit. You can truncate, numerically speaking, but depending on what you're doing, the result won't be very good.

When taking an image from a higher range down to 8-bits per channel, there are two specific cases where you tend to see bad banding problems. When doing high quality poster prints like a giclee or photo print, the printer's color gamut is drastically different from a monitor, so banding that you don't notice on a monitor can suddenly become a plainly visible eye sore in a print. This is a big problem if you're paying $100 for your large format print.

The other problem is when resizing an image down. The resampling process smoothes out noise in an image. Normally, a DSLR photo has a signal to noise ratio that is less than 8 bits, meaning even 16 bit RAW photos have noise that is stronger than the lower 8 bits. You can usually truncate the lower 8 bits without noticing. But if you resample the image and downscale it, the noise is smoothed and banding can appear. This can happen with photos of any large flat field of color, like a wall or the sky.

Re:Image Dithering: Eleven Algorithms and Source Code by grenoire on Friday October 06, 2017 @09:01AM (#15416433)
That results in banded ramps that are less pleasing than dithering.