Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Pixeling > dithering question
2023-03-01 11:11
NoiseEHC

Registered: Feb 2005
Posts: 51
dithering question

Hi!

I have been just looking at recently released MULTI graphics, and what I noticed is that the majority of images use horizontal line dithering. For example:
Always Look at the Bright Side of Life

While in the past most images used checkerboard dithering, for example Hein's graphics in Dutch Breeze. But current example:
Birdman

(Note both images contain both type of dithering, just one is much more dominant.)

And very few use diffuse (random) dithering for some reason.

So what is the reason of this difference? Is it only the preference of the artist, or is there an advantage of horizontal line dithering on a TV? I do not have a real C64 anymore, so I cannot check it unfortunately.

Another question: why are there so few diffuse dithering out there? Is this because this is much harder to do, or is there some visible disadvantage?

Thanks
2023-03-01 13:12
chatGPZ

Registered: Dec 2001
Posts: 11108
With alternating lines that have the same luma you can produce perfectly mixed colors on PAL (Emulators with CRT emulation should reproduce this correctly these days)
2023-03-01 13:59
Krill

Registered: Apr 2002
Posts: 2839
Something something optional client-side PAL filter on CSDb screenshots... =)
2023-03-01 14:16
NoiseEHC

Registered: Feb 2005
Posts: 51
Yeah, but with the above Always Look at the Bright Side of Life image, looking at it via VICE with PAL emulation, there is no color mixing.

Which is expected, as for example it uses black/blue, light-green/cyan. Hmm, maybe that picture was not the best example, I will look at some others...
2023-03-01 14:29
chatGPZ

Registered: Dec 2001
Posts: 11108
Mermaid has a couple that exploit it wonderfully <3
2023-03-01 16:08
ChristopherJam

Registered: Aug 2004
Posts: 1378
One thing worth mentioning is that checkerboard dithering in hires is a definite no-no*. It's very close to the colour carrier in both NTSC and PAL (a touch higher than NTSC, a touch lower than PAL). Either way, if you view it using a composite video or RF cable you get spurious colour banding.

Sadly it's not an effect you can safely take advantage of, as the phase is random with every power cycle.


* it's fine in multicolour
2023-03-02 06:13
NoiseEHC

Registered: Feb 2005
Posts: 51
Quote: Mermaid has a couple that exploit it wonderfully <3

Yeah, for example this:
No Returns No Refunds All Sales Final

It uses color mixing extensively. However there is very interesting that both the left of the backpack and both the top of the legs use the same dark blue / brown dithering, but the backpack looks greyish in PAL emulation while the legs look purplish. No matter if I resize the window.
https://i.ibb.co/vx3zBL3/pal-emu-differences.png

Is it the same how it looks on a real TV? Why?
2023-03-02 07:15
Oswald

Registered: Apr 2002
Posts: 5017
this works because PAL TVs display an average of neighbouring "rasterlines" hue. its a long story, I believe this is done to address a shortcoming of NTSC that came before.

I think main thing not using floyd steinberg style dithering that its simply fugly with brick sized multicolor pixels, it only starts looking good around 320x20 and higher. also FS to work you need larger areas, while in pixeling you want to go from color A to color B usually in short distance. This alternating line dither style is quite recent.

the color mixing the guys are talking above only works for 7 specific color pairs, the colors of the c64 palette which have the same brightness, results are usually strange colors, not usable across wide ranges.
2023-03-02 07:32
ChristopherJam

Registered: Aug 2004
Posts: 1378
Quoting NoiseEHC
very interesting that both the left of the backpack and both the top of the legs use the same dark blue / brown dithering, but the backpack looks greyish in PAL emulation while the legs look purplish. ... Why?


The hues for the odd line palette is slightly different to those for the even line palette - if you scroll the picture down a line (eg by writing 3c to $0904 in the viewer), those colours swap.
2023-03-02 12:51
NoiseEHC

Registered: Feb 2005
Posts: 51
There is this page which talks about the chroma/luma signals lagging a little:
https://jamontoads.net/p/lumachroma.html

Is this the thing which causes color bleeding? If so then would not it make sense to use it for color transitions? Because it should naturally create a transitional hires pixel between two multi block pixels. Or is it already widely used in pixel graphics? If so why there is not a vertical alternating lines fill prevalent?

And it would be good to get some info from a graphician why prefer horizontal lines over checkerboard patterns in multi mode. Can any of you ping an artist, please?

The reason I ask these questions because I am working on an editor which is a plugin for GIMP. The plan is to draw pictures using my pen tablet, which are converted into 16 color dithered images in real-time. Controlling colors/sprites will be done using some extra layers in the source image. Obviously it will work only if the dithering is good in the first place.
2023-03-02 13:55
Oswald

Registered: Apr 2002
Posts: 5017
thats a cool page, VICE should emulate that, totally looks like I remember the screens from back of the days.

Dont think it can be used in graphics much its a subtle subpixel effect.
2023-03-02 14:11
chatGPZ

Registered: Dec 2001
Posts: 11108
Color bleeding happens horizontally, while the PAL mixing happens vertically.

And yes, VICE (and every other emu) should emulate it - however, this is something to be implemented in shaders, its way too costly to do in software (if you want to do it correctly)
2023-03-02 15:28
Deev

Registered: Feb 2002
Posts: 206
Quote:

So what is the reason of this difference? Is it only the preference of the artist, or is there an advantage of horizontal line dithering on a TV? I do not have a real C64 anymore, so I cannot check it unfortunately.

Another question: why are there so few diffuse dithering out there? Is this because this is much harder to do, or is there some visible disadvantage?


I think horizontal versus checkerboard is mostly just a style preference. Obviously there are ways to blend colours using horizontal lines and I guess people are aware of those while pixelling, but I don't think that influences most of the choices on the examples you gave.

Personally I prefer checkerboard in most cases, I just think it looks better with my style. Some people's style might work better using lines.

As for diffuse dithering, I just think it looks kind of ugly. I prefer a neater, cleaner, more deliberate look. It's all about style preferences though.

Quote:

One thing worth mentioning is that checkerboard dithering in hires is a definite no-no*. It's very close to the colour carrier in both NTSC and PAL (a touch higher than NTSC, a touch lower than PAL). Either way, if you view it using a composite video or RF cable you get spurious colour banding.

* it's fine in multicolour


Again I'm very much aware this happens, but I don't think it makes it a no-no. Not supporting people using RF is no different than not supporting people loading from cassette.

And the reality is that most people judge an image based the screenshot anyway...
2023-03-02 16:36
ChristopherJam

Registered: Aug 2004
Posts: 1378
Quoting Deev
Not supporting people using RF is no different than not supporting people loading from cassette.


I mean, it's more like "only supporting people using s-video or buggy emulators" (admittedly at the moment the latter is most of them)

Quote:
And the reality is that most people judge an image based the screenshot anyway...


True - but again that does mean you're relying on shortcomings in the tools that make the screenshots. Golden Cow waiting to happen :)


NoiseEHC, Oswald - cheers for your interest in my video signal measurements article. As Groepaz pointed out, it'll probably take 'someone' writing a shader for emulating that properly to be performant. IIRC a few emulators do already emulate black-bleed to some extent at least.
2023-03-02 16:54
Deev

Registered: Feb 2002
Posts: 206
Quote:
I mean, it's more like "only supporting people using s-video or buggy emulators" (admittedly at the moment the latter is most of them)


Targetting a real C64 outputting s-video seems perfectly reasonable to me. Composite looks bad in lots of ways. Yes, some people might not have access to a better option (neither of the CRTs I own support s-video either), but again some people have nothing more to load from than a datasette.

And as for emulators, shouldn't these also recreate output through s-video?
2023-03-02 17:46
ChristopherJam

Registered: Aug 2004
Posts: 1378
Ok, fair points. Perhaps in the future it will just be like songs specifying which SID chip is preferred :)

After all, I prefer 8580 to 6581, 9-luma VIC to 5-luma VIC, and C64C (the original designers intent!) to C64, so in many ways I'm far from a traditionalist myself.

And at least s-video still exhibits black bleed* ;)

/me buys Deev a pint


* lighter pixels are a smidge narrower than darker pixels, as the luma rise time is longer than the fall!
2023-03-02 18:20
Hein

Registered: Apr 2004
Posts: 933
Quoting NoiseEHC
The reason I ask these questions because I am working on an editor which is a plugin for GIMP. The plan is to draw pictures using my pen tablet, which are converted into 16 color dithered images in real-time. Controlling colors/sprites will be done using some extra layers in the source image. Obviously it will work only if the dithering is good in the first place.


I haven't experimented alot with different patterns, but I think it'd be nice if you'd let the user select the pattern to use while painting. I suppose the choice depends on what kind of effect or material needs to be created.
2023-03-02 18:59
chatGPZ

Registered: Dec 2001
Posts: 11108
Quote:
And at least s-video still exhibits black bleed

Until you replace the Modulator by one of the replacement circuits - then it is gone :)
2023-03-02 22:09
Deev

Registered: Feb 2002
Posts: 206
Quote:
Ok, fair points. Perhaps in the future it will just be like songs specifying which SID chip is preferred :)


I'm certainly in favour of exploiting these things for effect if possible. I'm not sure it's possible to do anything too interesting in composite, but I'd love to see someone prove me wrong! Seeing what people do with the 5 luma VIC is always interesting as well.
2023-03-03 03:26
NoiseEHC

Registered: Feb 2005
Posts: 51
Quoting Hein
I haven't experimented alot with different patterns, but I think it'd be nice if you'd let the user select the pattern to use while painting. I suppose the choice depends on what kind of effect or material needs to be created.


Yeah, that is the plan to have different dithering settings, most likely per layer, or per character. But for that it would be awesome if more graphicians would give their two cents about THEIR completely subjective opinion about how they like to dither, the way Deev already did. Because I am not an artist, I am a coder. I know only how to write code...

On the other hand, there are two objective differences I can see between checkerboard and horizontal line dithering:
1. Checkerboards have half the pixels on the second lines, where vertical PAL color mixing change their color, effectively creating 4 different colors from a 2 color checkerboard pattern. It does not happen with horizontal lines, they only have 2 colors.
2. Checkerboards have the horizontal color bleeding everywhere, which does not happen with horizontal lines, which are obviously homogenous horizontally.



Quoting Groepaz
Color bleeding happens horizontally, while the PAL mixing happens vertically. And yes, VICE (and every other emu) should emulate it - however, this is something to be implemented in shaders, its way too costly to do in software (if you want to do it correctly)


As far as I see, VICE (GtkVICE 3.6.1) already emulates something like that, it would be good to know from a VICE developer if that is the same thing we are talking about here:
https://i.ibb.co/pbrbzhk/pal-color-mix-4x.png
(I marked the color pairs with identical luma with rectangles.)

On the left side it is a screen capture with "CRT emulation" enabled, where "Double size" is not checked, magnified 4x so it is easier to pick colors in a photo editor. On the right "Double size" is checked, so it was magnified only 2x, and you can see VICE emulates the darker void between pixels, but the colors of the middle of the pixels seems to be the same both cases.

What I see interesting is that while the color of first lines seem to remain constant horizontally, it actually varies it just a little bit depending on the color pair. The color of the second lines varies a lot more obviously, because of the vertical color mixing. It would be good to know if the default "Pepto (PAL)" palette of VICE is actually representative of a real C64, because in the past the colors of emulation seemed much-much more brilliant than the real thing...

For the horizontal bleeding, there are a lot of transitional pixels, and it seems that the transition is 2 (or rarely 3) pixel wide, which seems to match the measured Luma change speed in the above shared webpage.

If somebody could run the test program on a real c64 and make a good quality photo of the monitor itself, that would be awesome. (I guess a frame grabber might not generate an image like a TV, but who knows?)
https://drive.google.com/file/d/17ZkQf4xm0rRyNWLNbAO1z4fr6gM67m..
2023-03-03 07:15
Hein

Registered: Apr 2004
Posts: 933
Quoting NoiseEHC
Yeah, that is the plan to have different dithering settings, most likely per layer, or per character.

How about selecting dithering (texture, hardness, opacity etc.) same as selecting a brush? Maybe also detect mouse direction and speed and change the dithering pattern based on that. This would feel more natural to me.

Then again, I'll leave the dithering to the pros, hope the other graphicians want to share their preference.
2023-03-03 10:15
Oswald

Registered: Apr 2002
Posts: 5017
suggestion: make dither "strongness" adjustable with mousewheel, and some drop down list to select style.
2023-03-03 12:23
chatGPZ

Registered: Dec 2001
Posts: 11108
Quote:
As far as I see, VICE (GtkVICE 3.6.1) already emulates something like that, it would be good to know from a VICE developer if that is the same thing we are talking about here

First, use a recent VICE, not the one from last year. In recent VICE the colors used are from new measurements (made by Tobias) that accurately represent the differences between odd and even lines, and the differences between old/new VIC. Do NOT use any external palettes - because then those things are plain wrong. Do NOT disable double size, because then some aspects of the CRT emulation do not work right. Basically leave everything at their default settings. Preferably use the latest development build from https://github.com/VICE-Team/svn-mirror/releases - then you will also get the recently fixed default for gamma correction (which was not neutral before). And if the colors are too vibrant for your taste, dial down brightness/saturation/contrast all to 100%. It does not make a lot of sense to use a color picker to pick individual pixel colors from the resulting output either :) If you want to use a palette for your gimp experiments, you might want to use the "colodore" palette, which is more accurate than "pepto". (Or ask Tobias for the calculated averaged RGB palette based on his measurements, that will be even more accurate)

Now for what it emulates and how good:
- The vertical color mixing ("PAL" mixing) is very accurate and reproduces all known side effects. That includes "hannover bars", and the differences between monitors that use a delay line only for one color component ("u only delayline" setting). The later is the case for example in the 1084 monitor. As said above, you must NOT use any external palette (or disable double size), or those things will not work right.
- The horizontal color mixing ("color bleeding") is not emulated well, it is basically just some blur. In particular non linear effects like "black bleed" is not reproduced at all, nor is chroma/luma crosstalk (the famous green/red pattern you can see when doing a checkerboard pattern in hires). I believe the current state is closest to what a C64C (new VIC) produces when the modulator has been removed, and the s-video signal is used.

Last not least here are some test programs: https://sourceforge.net/p/vice-emu/code/HEAD/tree/testprogs/crt..
2023-03-09 12:48
NoiseEHC

Registered: Feb 2005
Posts: 51
Thank you for taking the time for this informative response!

Quoting Groepaz
First, use a recent VICE, not the one from last year. In recent VICE the colors used are from new measurements (made by Tobias) that accurately represent the differences between odd and even lines, and the differences between old/new VIC. Do NOT use any external palettes - because then those things are plain wrong. Do NOT disable double size, because then some aspects of the CRT emulation do not work right. Basically leave everything at their default settings. Preferably use the latest development build from https://github.com/VICE-Team/svn-mirror/releases - then you will also get the recently fixed default for gamma correction (which was not neutral before).


Yeah, in the meantime I moved to the latest release, but now I started using GTK3VICE-3.7.1-win64-r43382. The "change" to the "pepto" palette was only my misunderstanding of the settings dialog. I thought that "internal" means that you choose from the internal palettes using the combo box, and "external" means that you have to load the palette with the folder button. The newer UI is not that confusing though. (The best would be to have "internal" the first item in the combo box and remove the radio buttons, but in r43382 it is good enough I think.)

Quoting Groepaz
And if the colors are too vibrant for your taste, dial down brightness/saturation/contrast all to 100%.


I like vibrant colors. My concern was if the colors are not the same as in a C64 monitor, but if these are measured then that is awesome.


Quoting Groepaz
Now for what it emulates and how good:
- The vertical color mixing ("PAL" mixing) is very accurate and reproduces all known side effects. That includes "hannover bars", and the differences between monitors that use a delay line only for one color component ("u only delayline" setting). The later is the case for example in the 1084 monitor. As said above, you must NOT use any external palette (or disable double size), or those things will not work right.
- The horizontal color mixing ("color bleeding") is not emulated well, it is basically just some blur. In particular non linear effects like "black bleed" is not reproduced at all, nor is chroma/luma crosstalk (the famous green/red pattern you can see when doing a checkerboard pattern in hires). I believe the current state is closest to what a C64C (new VIC) produces when the modulator has been removed, and the s-video signal is used.


And here is my problem. In VICE I can create very interesting effects, but I am not that sure now if the display represents reality or not. Or maybe reality has changed in the past to look more like VICE without CRT emulation? :)

Here is a picture from last year's Transmission64 (I asked them and they are recording separate luma/chroma):
https://youtu.be/WwHTp5tI9mY?t=509
The prg file can be found here:
Boimyboi

For example the light red / dark green mix on the neck of the frog looks quite similar both in VICE and on YouTube. But on YouTube the odd/even lines do not look different color at all, while VICE emulates the cheap PAL chroma phase mirroring effect. How can it be? The other difference is that there is some color mixing on YouTube, but it is much less than in VICE. Which one is real?

I am interested in these details because I would like to create some cool effects in my next demo, but it would be kinda pointless if none of the compos would support the real C64 output... :)

Currently I am not 100% convinced if the VICE CRT emulation is the real thing, as I have no access to a real C64 and that way it is quite hard to check it. I will try to find some scene people in New Zealand, as I saw that there were several groups here, and will try to borrow a real C64 and monitor to check my assumptions. In case compos do not look real I can still release my demo just on csdb I guess.
2023-03-09 12:51
Jetboy

Registered: Jul 2006
Posts: 212
Quote: Hi!

I have been just looking at recently released MULTI graphics, and what I noticed is that the majority of images use horizontal line dithering. For example:
Always Look at the Bright Side of Life

While in the past most images used checkerboard dithering, for example Hein's graphics in Dutch Breeze. But current example:
Birdman

(Note both images contain both type of dithering, just one is much more dominant.)

And very few use diffuse (random) dithering for some reason.

So what is the reason of this difference? Is it only the preference of the artist, or is there an advantage of horizontal line dithering on a TV? I do not have a real C64 anymore, so I cannot check it unfortunately.

Another question: why are there so few diffuse dithering out there? Is this because this is much harder to do, or is there some visible disadvantage?

Thanks


> And very few use diffuse (random) dithering for some reason.

The reason is quite simple. It is used when converting ready image, by device that does not care to do a lot of calculations, but for human doing it while painting would be fucking inconvenient and hard to automate. People are lazy and tend to use solutions that are less work for them :) Unless they try to prove a point :) Well, most of the scene prods are doing that though. "So you say it is impossible? Please hold my beer..."
2023-03-09 15:11
chatGPZ

Registered: Dec 2001
Posts: 11108
Quote:

For example the light red / dark green mix on the neck of the frog looks quite similar both in VICE and on YouTube. But on YouTube the odd/even lines do not look different color at all, while VICE emulates the cheap PAL chroma phase mirroring effect. How can it be? The other difference is that there is some color mixing on YouTube, but it is much less than in VICE. Which one is real?

Never judge those things from a recording - and much less from youtube video. That adds so many things to the mix, all of which may introduce additional "smoothing". On my setup (new C64/1701 monitor) eg the odd/even lines difference is even more visible than in default VICE settings, eg in solid violet areas.

Quote:
I am interested in these details because I would like to create some cool effects in my next demo, but it would be kinda pointless if none of the compos would support the real C64 output... :)


You probably can not rely on the details of those things, they will not be reproduced the same on different c64+crt setups, and some things just wont be reproduced correctly at all once you add a projector or recording into the mix. I'd always at least check with a couple different c64+crt combinations - And then you will likely come to the conclusion that you can only rely on the principle of PAL mixing, but not on certain details.

Regarding emulation this is a similar problem as SID filters. There is no "right" or "wrong" when it comes to certain things, and all the emulator can try to do is matching "a" C64. But it will never match "all" C64s. And it will always be different to "your" C64 =)
2023-05-04 12:55
NoiseEHC

Registered: Feb 2005
Posts: 51
Quoting Groepaz
Quote:

On my setup (new C64/1701 monitor) eg the odd/even lines difference is even more visible than in default VICE settings, eg in solid violet areas.


Today I finally got an analog TV (Panasonic TX-29S95Z) which has an S-Video port - that is why I choose this one, getting a Commodore monitor here is night impossible. I have created a Luma/Chroma cable, and the results with a C64C are below (unfiltered is when my cheapo phone camera focused on the TV pixels):
https://i.ibb.co/Thf4hqy/c64-filtered.jpg
https://i.ibb.co/dt7n7k2/c64-unfiltered.jpg

There is absolutely no difference between even/odd lines. How can it be? Does it happen only through composite connection? I do not think so, as your 1701 should be connected with a Luma/Chroma cable...
2023-05-04 13:18
NoiseEHC

Registered: Feb 2005
Posts: 51
What is even more interesting is that if I connect with RF, then there is still no even/odd line difference, but there is a very visible dot crawl (https://en.wikipedia.org/wiki/Dot_crawl).
https://i.ibb.co/G2Vb8Gs/c64-rf-filtered.jpg

This dot crawl was one of the reasons that I did not use my big LCD TV. (The other is that it lost the sync of the C64 repeatedly, so I thought that the problem is with the C64 signal and LCD TV DSP compatibility.)

So now I think that the dot crawl might be simply that the DSP ICs in modern TVs interpret the wrong Chroma phase as a pixel shift every even line? Can it be? If so then how could I check this?
2023-05-04 13:54
chatGPZ

Registered: Dec 2001
Posts: 11108
This TV seems to be quite modern and probably does more image processing than what a plain old PAL TV does... one interesting feature is that you can apparently independently select the color system (and it has both "old" and "new" NTSC) and the audio carrier frequency (this is usually tied to the color system in a certain region). My guess would be that it simply evens out the difference between two adjacent lines completely, perhaps by mixing 3 instead of 2 lines, or something like that. You could play with the "sharpness" parameter and see if that makes it visible in one of the extremes. There is also a "channel colour set" parameter which is not really explained in detail.
2023-05-04 14:18
NoiseEHC

Registered: Feb 2005
Posts: 51
Can you please post a photo how your image looks like? (It can be uploaded to imgbb.com without creating an account there...)

The image is just inverse (Control+9 RVS ON) SPACE characters with the colors changes by Control+1..8 then Commodore+1..8

When I was young, we were poor so I never had a color monitor, coded on a mono one so unfortunately have no idea how it should look like. Two pictures with and without visible TV pixels would be the best. Thanks!!!
2023-05-04 14:27
chatGPZ

Registered: Dec 2001
Posts: 11108
I'll do... but cant now, there is a bit of chaos around me and the setup is out of order right now :) Perhaps someone else can help out? :)
2023-05-08 08:12
NoiseEHC

Registered: Feb 2005
Posts: 51
After paying a ridiculous amount of money to buy it, then driving 16 hours to fetch it, I am a proud owner of an original Commodore 1802 monitor.

Still no even/odd lines, LOL:
https://i.ibb.co/QcMQZBf/commodore-1802.jpg

I will borrow another C64 and will test with that, maybe I have a special unit, who knows?
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
Seppo Heavy
Didi/Laxity
d0c
Guests online: 135
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 The Ghost  (9.6)
9 Wonderland XIV  (9.6)
10 Bromance  (9.6)
Top onefile Demos
1 It's More Fun to Com..  (9.8)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 Rainbow Connection  (9.5)
6 TRSAC, Gabber & Pebe..  (9.5)
7 Onscreen 5k  (9.5)
8 Wafer Demo  (9.5)
9 Dawnfall V1.1  (9.5)
10 Quadrants  (9.5)
Top Groups
1 Oxyron  (9.3)
2 Nostalgia  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 S!R  (9.9)
3 Mr Zero Page  (9.8)
4 Antitrack  (9.8)
5 OTD  (9.8)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.148 sec.