Re Dithering using windows palette 16 colors
Message-ID:<3659ca8b-a160-4900-9803-f03ce5c0f794@d1g2000hsg.googlegroups.com>
Subject:
Re: Dithering using windows palette (16 colors)
Date:Mon, 6 Oct 2008 04:24:23 +0100
On Oct 3, 12:52=A0pm, "4N"wrote: > Hi, > > I'm trying to enhance my code for ordered dithering because my > code picks, in relatively large areas, almost always the grays in > the 16 colors palette of windows. > I can't seem to find a simple and effective solution to loss of color, > that's why I'm trying to discuss this with other people. > I hope someone can give me a good hint. > > Thanks in advance. Methods that work well with somewhat higher bit depths are well studied. One particularly effective algorithm is this one: http://members.ozemail.com.au/~dekker/NEUQUANT.HTML In the FAQ on that page you can see suggestions that might work for 16 colours. Also see: http://en.wikipedia.org/wiki/Color_quantization http://web.cs.wpi.edu/~matt/courses/cs563/talks/color_quant/CQindex.html
Message-ID:<394e6587-5b14-4dd4-8bb3-9efd53f0e411@p58g2000hsb.googlegroups.com>
Subject:
Re: Dithering using windows palette (16 colors)
Date:Sat, 11 Oct 2008 23:52:10 +0100
On Oct 6, 12:38=A0pm, "4N"wrote: > ... the > palette is fixed and it is the 16-colors palette of windows. > Using the euclidean metric with that palette, the grays in the palette ar= e > picked pretty often resulting in relatively larges gray zones. It seems that the problem is somewhat subjective, and I'm not sure what kind of solution you're looking for, but as simple workarounds you could try weighting the picks away from greys, e.g. using probabilistic rejection. Did you try just increasing saturation of the source image? > I tried Riemersma metric and it doesn't help, and honestly I'm short on > option if I want to keep good performaces...
Message-ID:<48f239fd$0$18157$4fafbaef@reader3.news.tin.it>
Subject:
Re: Dithering using windows palette (16 colors)
Date:Sun, 12 Oct 2008 18:56:06 +0100
> It seems that the problem is somewhat subjective, and I'm not sure > what kind of solution you're looking for, but as simple workarounds > you could try weighting the picks away from greys, e.g. using > probabilistic rejection. deterministic rejection works except with this palette. I wonder how to code a probabilistic rejection... > Did you try just increasing saturation of the > source image? yes, the whole image is affected => not good.
Message-ID:<48f38ba1$0$18155$4fafbaef@reader3.news.tin.it>
Subject:
Re: Dithering using windows palette (16 colors)
Date:Mon, 13 Oct 2008 18:56:40 +0100
> I was thinking that your colour matching function (you're using > closest Euclidean?) yes, I do > could ignore greys with a certain probability (or > a variable probability). to make a pratical example I could use a gaussian noise generator and to reject the grays if the value is over 0.5? Using these parameters the image looks only slightly better, and I think I have to tweak my code a little, but I introduce too much randomness in the ordered dithering. Btw I'll upload a couple of images to show you the results later.
Message-ID:<7eb0f99b-241d-47af-a25c-85a179c7df4c@m36g2000hse.googlegroups.com>
Subject:
Re: Dithering using windows palette (16 colors)
Date:Mon, 13 Oct 2008 21:33:26 +0100
On Oct 13, 1:56 pm, "4N"wrote: > > I was thinking that your colour matching function (you're using > > closest Euclidean?) > > yes, I do > > > could ignore greys with a certain probability (or > > a variable probability). > > to make a pratical example I could use a gaussian noise generator and to > reject the grays if the value is over 0.5? Uniform random number, yes. > Using these parameters the image looks only slightly better, and I think I > have to tweak my code a little, but I introduce too much randomness in the > ordered dithering. Ordered dithering? You mean error diffusion? > Btw I'll upload a couple of images to show you the results later. Thanks, it would be interesting to compare.
Message-ID:<9642e5d8-aa0d-4cdd-a59c-1a24b3a404db@64g2000hsm.googlegroups.com>
Subject:
Re: Dithering using windows palette (16 colors)
Date:Thu, 16 Oct 2008 05:01:55 +0100
On Oct 13, 6:45=A0pm, "4N"wrote: > > Ordered dithering? You mean error diffusion? > > no, I do mean ordered dithering, like dispersed or clustered dot ditherin= g. > and here are a couple of samples: > > (Floyd-Steinberg) > img511.imageshack.us/my.php?image=3Dlenafloydwr9.png > (Bayer ordered dithering) > img80.imageshack.us/my.php?image=3Dlenaorderedxz9.png Yes I am familiar with both processes.
Message-ID:<48f75813$0$1073$4fafbaef@reader2.news.tin.it>
Subject:
Re: Dithering using windows palette (16 colors)
Date:Thu, 16 Oct 2008 16:06:01 +0100
After some tweaking of my code I obtained this result that is the best result I've seen so far (using other applications too) img352.imageshack.us/my.php?image=lenabayerdm0.png
Message-ID:<20081124204811.2eb08338@mage>
Subject:
Re: Dithering using windows palette (16 colors)
Date:Mon, 24 Nov 2008 11:48:11 +0100
On Thu, 16 Oct 2008 17:06:01 +0200 "4N"wrote: | After some tweaking of my code I obtained this result that is the best | result I've seen so far (using other applications too) | | img352.imageshack.us/my.php?image=lenabayerdm0.png | | I would not mind knowing the actual method you used for this. Ordered dither using a fixed color map is not a straight forward thing to work out.
Message-ID:<492d914b$0$1076$4fafbaef@reader2.news.tin.it>
Subject:
Re: Dithering using windows palette (16 colors)
Date:Wed, 26 Nov 2008 19:13:32 +0100
"Anthony"ha scritto nel messaggio news:20081124204811.2eb08338@mage... > On Thu, 16 Oct 2008 17:06:01 +0200 > "4N" wrote: > > Ordered dither using a fixed color map is not a straight forward > thing to work out. I noticed, still I was able to obtain some decent result, and when I will have some time I'll try a couple of other solutions I recently thought of...
Message-ID:
Subject:
Re: Dithering using windows palette (16 colors)
Date:Tue, 7 Oct 2008 10:23:20 +0100
4N wrote: > Hi, > > I'm trying to enhance my code for ordered dithering because my > code picks, in relatively large areas, almost always the grays in > the 16 colors palette of windows. > I can't seem to find a simple and effective solution to loss of color, > that's why I'm trying to discuss this with other people. > I hope someone can give me a good hint. As a simple test, try using your code on a LARGE picture, then convert your image to RGB, and smooth/subsample it. Then compare the result with a similarly subsampled original. The original image needs to be large enough that the subsampling can be around 8 or more. If your code is working correctly, the two images should be similar. If they're not, you have a bug. BugBear
Message-ID:<48ecf1fe$0$1092$4fafbaef@reader1.news.tin.it>
Subject:
Re: Dithering using windows palette (16 colors)
Date:Wed, 8 Oct 2008 18:36:05 +0100
"bugbear"ha scritto nel messaggio news:zamdnQU7iIBHHXHVnZ2dnUVZ8t7inZ2d@posted.plusnet... > 4N wrote: >> "bugbear" ha scritto nel messaggio >> news:cJ6dnfnyCc0Vt3bVnZ2dnUVZ8s3inZ2d@posted.plusnet... > I suggested: > case (A) dither a large image, sub sample by (e.g.) 8 > case (B) subsample the same large image by (e.g.) 8 > compare the result of (A) and (B). well, obviously there is some desaturated area... but my code is organized so that only the generator of the palette changes, so actually the code of the dithering is the same and only the content of the palette is changed (its colors). When I use median cut everything is fine, the problems arise only when I fill the palette with the colors of the windows palette. Anyway this happens in other programs too.
Message-ID:<_MGdndybFrJiWXDVnZ2dnUVZ8qrinZ2d@posted.plusnet>
Subject:
Re: Dithering using windows palette (16 colors)
Date:Thu, 9 Oct 2008 09:46:55 +0100
4N wrote: > "bugbear"ha scritto nel messaggio > news:zamdnQU7iIBHHXHVnZ2dnUVZ8t7inZ2d@posted.plusnet... >> 4N wrote: >>> "bugbear" ha scritto nel messaggio >>> news:cJ6dnfnyCc0Vt3bVnZ2dnUVZ8s3inZ2d@posted.plusnet... >> I suggested: >> case (A) dither a large image, sub sample by (e.g.) 8 >> case (B) subsample the same large image by (e.g.) 8 >> compare the result of (A) and (B). > > well, obviously there is some desaturated area... > but my code is organized so that only the generator of the palette changes, > so actually the code of the dithering is the same and only the content of > the palette is changed (its colors). > When I use median cut everything is fine, the problems arise only when I > fill the palette with the colors of the windows palette. Over a sufficiently large area (the point of my subsampling in the check I propose) any accurate implementation of error diffusion dithering should work, as long as the pallette has examples of the color space extremes. Obviously (?) if the pallette doesn't contain (e.g.) a fully saturated blue, a fully saturated blue input cannot be handled. BugBear
Message-ID:<48ee0b87$0$1074$4fafbaef@reader2.news.tin.it>
Subject:
Re: Dithering using windows palette (16 colors)
Date:Thu, 9 Oct 2008 14:49:18 +0100
"bugbear"wrote: > Over a sufficiently large area (the point of my subsampling in the check > I propose) any accurate implementation of error diffusion dithering should > work, > as long as the pallette has examples of the color space extremes. It's obvious, that's why I previously misinterpreted what you wrote. > Obviously (?) if the pallette doesn't contain (e.g.) a fully saturated > blue, a fully saturated blue input cannot be handled. Palette: 255 255 255 0 255 255 255 0 255 255 255 0 0 0 255 0 255 0 255 0 0 0 0 0 128 128 128 0 128 128 128 0 128 128 128 0 0 0 128 0 128 0 128 0 0 192 192 192 as you can see it contains the fully saturated r,g and b components: 0 0 255 0 255 0 255 0 0



RSS News Feed