Please tell me about dithering. How can I change color depth of bmp 24 bits to bmp 4 bits?
-
Hi! Please tell me about dithering algorithm clearly. I try to change color depth of bmp 24 bits to 4 bits, but my algorithm is not good...Then someone tell me about dithering, but not clearly, they don't give me an algorithm or clear idea but that's an introduction about dithering...So if you can, please tell me about dithering algorithm clearly. Thanks and waiting for your replies. Best regards, FlytotheBlueSky
-
Hi! Please tell me about dithering algorithm clearly. I try to change color depth of bmp 24 bits to 4 bits, but my algorithm is not good...Then someone tell me about dithering, but not clearly, they don't give me an algorithm or clear idea but that's an introduction about dithering...So if you can, please tell me about dithering algorithm clearly. Thanks and waiting for your replies. Best regards, FlytotheBlueSky
A simple, efficient, and effective solution is error diffusion. The idea is to find the error between the color you want and the color you can produce. You move that error into neighboring pixels. The error accumulates until it reaches the threshold for the next representable color. The effect is surprisingly good. The algorithm as documented is good for one dimension of color (monochrome). The full color spectrum has three dimensions, so you'll have to apply error diffusion on all three individually. Try it with the red, green, and blue values and see how it works out. If that doesn't look good enough, post again and I'll dig up my HLS color code.
-
Hi! Please tell me about dithering algorithm clearly. I try to change color depth of bmp 24 bits to 4 bits, but my algorithm is not good...Then someone tell me about dithering, but not clearly, they don't give me an algorithm or clear idea but that's an introduction about dithering...So if you can, please tell me about dithering algorithm clearly. Thanks and waiting for your replies. Best regards, FlytotheBlueSky
My answer does not address your question directly, since a good answer has already been given. I just wanted to remind you that if you are doing this to conserve space you will only get a gain of 6x at the expense of a very significant quality loss (at least on photographic images). A compression such as JPEG can give you a gain of 20x without losing nearly as much quality (in fact very little quality loss), and I think that even at 50x compression ratio it will still have better quality than any 4bpp BMP diethering. There is a number of JPEG libraries out there, some highly optimized (like INTEL's). I hope this helps, Rogério
-
A simple, efficient, and effective solution is error diffusion. The idea is to find the error between the color you want and the color you can produce. You move that error into neighboring pixels. The error accumulates until it reaches the threshold for the next representable color. The effect is surprisingly good. The algorithm as documented is good for one dimension of color (monochrome). The full color spectrum has three dimensions, so you'll have to apply error diffusion on all three individually. Try it with the red, green, and blue values and see how it works out. If that doesn't look good enough, post again and I'll dig up my HLS color code.
thanks: https://movied.org
-
Hi! Please tell me about dithering algorithm clearly. I try to change color depth of bmp 24 bits to 4 bits, but my algorithm is not good...Then someone tell me about dithering, but not clearly, they don't give me an algorithm or clear idea but that's an introduction about dithering...So if you can, please tell me about dithering algorithm clearly. Thanks and waiting for your replies. Best regards, FlytotheBlueSky
thanks: https://movied.org
-
My answer does not address your question directly, since a good answer has already been given. I just wanted to remind you that if you are doing this to conserve space you will only get a gain of 6x at the expense of a very significant quality loss (at least on photographic images). A compression such as JPEG can give you a gain of 20x without losing nearly as much quality (in fact very little quality loss), and I think that even at 50x compression ratio it will still have better quality than any 4bpp BMP diethering. There is a number of JPEG libraries out there, some highly optimized (like INTEL's). I hope this helps, Rogério
thanks: https://movied.org