18-bit with dithering

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
hatfieej
Posts: 1
Joined: 2014-02-07T12:00:15-07:00
Authentication code: 6789

18-bit with dithering

Post by hatfieej »

I'm looking to convert an image to 18-bit color (6 bits for R, G, and B each) but would like it to also dither the image so the banding doesn't look as bad. I'd prefer the dithering to not be the basic ordered pattern -- something more like Floyd-Steinberg or one of the others. I've gotten the image to convert to 18-bit (using posterize and threshold), but those create banding in the image. I can't figure out how to do that with a nice dithering algorithm too. I'm sure they has to be a way, I just haven't figured it out yet. Any ideas? Thanks.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: 18-bit with dithering

Post by snibgo »

If I recall correctly, "-posterize" can't dither. But you can use that to get the list of colors, then "-remap" the image to itself, or a "unique-colors" version of itself. "-remap" can dither.

It's a slightly crazy way of doing it, especially if you have many or large images. You could skip the posterize and go straight to remap by creating your own map with (2^6)^3 = 262144 entries (pixels).
snibgo's IM pages: im.snibgo.com
Post Reply