dithering

Dithering child elements' dimensions to fill a parent element

微笑、不失礼 提交于 2019-12-13 07:00:02
问题 Say I have a parent div with width 500px. It has 13 child elements that should fill its width. If I give each child element a width of 500 / 13 = 38.46... pixels, the browser will floor the pixel values, so I end up with 13 elements that take up a total of 38 * 13 = 494 pixels. There will be 6 pixels on the right side of the parent div that are not filled. Is there an easy way to dither the child element widths so that the remainder (6 pixels) is distributed among some of the child elements,

PIL - Dithering desired, but restricting color palette causes problems

痞子三分冷 提交于 2019-12-12 15:27:59
问题 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 images with only 16 colors at a time (but they can be specified RGB triplets). So, I'd like to automate the task of taking an arbitrary true-color PNG image, choosing an "optimum" 16-color palette to represent it, and converting the image to a

Fastest dithering / halftoning library in C

假如想象 提交于 2019-12-05 10:08:04
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 4bit (16 colors) grayscale palette. I'm currently using LibGraphicsMagick to dither images (RGB->4bit grayscale), which is an apparent bottleneck in the server performance. Profiling shows that more than 70% of time is spent running GraphicsMagick dithering functions. I've explored stackoverflow and the Interwebs for a good high performance solution,

Floyd–Steinberg dithering alternatives for pixel shader

≯℡__Kan透↙ 提交于 2019-12-05 00:47:05
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 Floyd-Steinberg algorithm ? So the question is - What are dithering algorithms which are suitable to implement on pixel shader (preferably GLSL) and with output quality (very) similar to Floyd-Steinberg dithering ? BTW. Multi-pass algorithms are allowed until there are not more than 2 passes and CPU overhead between those passes is small. Any ideas ? EDIT: I

c# image dithering routine that accepts an amount of dithering?

与世无争的帅哥 提交于 2019-12-02 10:11:27
I've been using aforge's floyed-steinberg dithering method, but I noticed that you can't specify the amount of dithering. I'd like to be able to specify an amount between 0 and 100. So that if I ask for 50, it will dither half as much as 100. Or, if I specify 0, then the resulting image will be made of solid colors with hard edges between each color... or in other words, no dithering. I'm looking for c# code for a routine such as floyed-steinberg, or Jarvis, Judice, Ninke dithering, that accepts an amount. anyone know of any? Spektre with slight change of this dithering you can achieve the

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

夙愿已清 提交于 2019-11-30 07:24:35
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 provide some methods, but I can't tell if they dither or not. And, if they do dither, what mechanism are they using (Floyd-Steinberg?) Does anyone have a good example of bitmap color-depth conversion with dithering? As you mentioned, the Floyd-Steinberg dithering method is popular because it's simple and fast. For the subtle differences between 24-bit

Color Banding Android Solution

最后都变了- 提交于 2019-11-29 12:54:02
What is possible solution to banded images in Android Activity or in OpenGl. Look at the answer below. Hope it Helps Color Banding Solved ooooooooooyyyyyyyeaaaaaaaaaa I solved color banding in two phases 1) * when we use the BitmapFactory to decode resources it decodes the resource in RGB565 which shows color banding, instead of using ARGB_8888, so i used BitmapFactory.Options for setting the decode options to ARGB_8888 second problem was whenever i scaled the bitmap it again got banded 2) This was the tough part and took a lot of searching and finally worked * the method Bitmap

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

依然范特西╮ 提交于 2019-11-29 09:31:36
问题 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 provide some methods, but I can't tell if they dither or not. And, if they do dither, what mechanism are they using (Floyd-Steinberg?) Does anyone have a good example of bitmap color-depth conversion with dithering? 回答1: As you mentioned, the Floyd

OpenGL gradient banding on Android

你。 提交于 2019-11-29 08:31:50
I've got a live wallpaper out on the market which uses OpenGL to render some basic shapes and a flat plane. The simple lighting creates a gradient effect across the plane, which looks fine on most devices. The Samsung Galaxy S2 series seems to have some trouble rendering the gradient, though, as you can see in this screen shot: The color banding looks awful, especially compared to this screen shot from an Incredible: I'm using a 565 EGL config in both cases, so I believe this is just a display issue with the GS2 devices. Can anyone confirm this suspicion? Is there any solution to the banding?

Bayer Ordered Dithering

爱⌒轻易说出口 提交于 2019-11-29 05:10:27
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 i thought it would be a nice addition to have that in so i started to search on the internet for something useful, i ended up on this wiki page here http://en.wikipedia.org/wiki/Ordered_dithering , and tried to do as written in the pseudo code for (int y = 0; x < image.Height; y++) { for (int x = 0; x < image.Width; x++) { Color color = image