Hello, Guest the thread was called9.6k times and contains 228 replays

last post from mathop at the

Helligkeiten der C64 PAL-Palette - zum 100. Mal

  • Yes, I'd rather separate the digital part, which is application controllable, from the picture generation, which underlies various phenomena until it reaches the eye.

    Those require a complete emulation of its own with a lot of knobs to turn that would reflect all the influences the picture is subjected to unter real world conditions.

  • Hi,

    I can't speak for OP, but I would like to point to pages like, for example at https://www.pepto.de/projects/colorvic/ where it says that the luminances fit neatly in a 32 level scale. I would assert that this is not how things work.


    it seems that you can.;)

    Peptos explanations were one reason to once more touch the palette. I was also wondering about the magic 32 steps.
    In his Colodore appraoch, Pepto at least revised his color angles.

    https://www.pepto.de/projects/colorvic/2001/

    "All these angles are perfectly dividable by 22,5° (which is a quarter of 90°)."

    But he sticked at his luminance steps in Colodore. At least for the definiton. If you check the luminaces of the resulting Colodore RGB palette, the run of the luminaces changed very much.


    I wrote to Pepto and he explained that he found those 32 steps as somehow an average of the Marko measurements to a level he was satisfied with. That doesn't sound like a "all of those levels are perfectly dividable by 32" any more, right?
    Well, the ratio of the steps is important and Pepto's approach basically was/is ok. This finding made his first palette the most harmoinc one, besides being too dark and flat.

    Some postings ago, I published an Excel sheet with a more universal approach where you just input luminance level 1 and 7, all others are calculated.

    I believe most capture cards have some kind of automatic gain circuit. This multiplies and/or shifts the input voltage such that the sync signal is then effectively at 0V and blank/black at 0.3V (with the assumption that pure white is then at 1V). Then you can adjust the voltages to obtain brightness levels (0.3V = 0, 1V = 255.)

    When seeing the different luinance signal levels of the chip revisions, I did not like the idea not to consider this differences. But meanwhile, I reconsidered this.
    Because noone will compare different C64s with different VIC-IIs directly next to each other in A-B comparison setup, I think the contrast thing is more important.
    Let's take two examples. If you have a look on your (CRT) monitor at daytime, the no working screen is far away from being pure black. If you have a newspaper, the paper color also is far away from being pure white.
    Nevertheless, both media can deliver a satisfying picture reporduction, because the eye adjusts to the boundary conditions.
    So I agree that it might be the most useful approach to set each black signal to 0 and the white level to 255, not considering the "real" PAL voltages. I am also no broadcast engineer, maybe the TV/monitor input stages even do some kind of auto-leveling as you described for the capture card.


    Guys, I'm trying to follow you on that matter and did so since the discussion began (already on Facebook).

    But I'm seriously losing track of it. What exactly are you trying to find out that was previously unsolved?


    The aim is to better understand the VIC-II video signal and if possible/necessary, to improve the already well working C64 palettes.


    mathop


    I think we are quite clear on the 6569 luminaces (if the differences really came only from the chip and not from individual tolerances or wrong combinations with the boards/modualtors:/).
    Also from your measurements of the 6569R5, I think we have a detailed understanding about the color generation, at least for the measured indivdual one.


    How can we better define the chrominance level? All colors have the same "saturation", correct?
    I did not fully understand your setting when measuring the more saturated signals. You did some settings (contrast, saturation) in your capture card, right? Why?
    http://www.michiel.boland.org/c64_colors_b1_adjusted.html

    To me, those colors look very saturated. The brightness of brown in this saturated palette is a bit too high as well.


    What I could see from your measurements is that the Ultimate64's orange/brown are incorrect.:D They share the same color angle which I think is wrong.

    http://www.michiel.boland.org/c64_colors_u64.html

    In my opinion, for example the brown always is more "dirty".


    It would be interesting to see some measurements of a 8565R2. For some reason, noone ever did this until today.

  • I did a short analysis of this:
    http://www.michiel.boland.org/c64_colors/luma_colors.txt


    I compared the chroma voltages with the saturation of the (desaturated) palette.
    sqrt(U²+V²) for the desaturated one is around 0.145, for the saturated around 0.225.

    Even Brown Composite volltage looks a bit "special".:/ Maybe just a typo.

  • The aim is to better understand the VIC-II video signal and if possible/necessary, to improve the already well working C64 palettes.

    This theoretical approach makes me scratch my head. It's going to take a lifetime to find out all interna, and still the picture won't look real as it is influenced by a number of phenomena along its way to the eye. It seems just as vain to me as my wife's attempts to find out why some people are evil. Even if she knew, it wouldn't change a thing. ;-)


    You have things like color bleeding, PAL color phase reversal, line blending, etc. that just won't be covered by this approach. IMHO you'd be better off to develop a series of test screens that will allow you to systematically visually create a good looking approximation. Real CRT screen right, your screen left, and move the sliders till it looks close enough.


    But I'm curious to see if I should be entirely mistaken. :)

  • You have things like color bleeding, PAL color phase reversal, line blending, etc. that just won't be covered by this approach.

    I agree that there are more effects involved at the end. But those also could be simulated and some of them already are being simulated in emulators.
    For e.g. even the fact that hires black pixels do "eat" other neighbour pixels could be simulated. The C64 video signal just is not clean and fast enough:
    https://jamontoads.net/p/lumachroma.html


    Also there is the PAL color mixing of equi-luminant colors alternating them in lines. Depending which color is on even or odd line, this will lead to slightly different mix colors.
    At least from my knowledge, this could not be explained until now. With the line color measurements of mathop, I think things became more clear.
    What I want to say: It never hurts to go further. ;)


    But all of those effects have nothing to do with the actual C64 colors. If you better define the basic "palette", the whole emulation chain can only benefit from it.
    I want to emphasize that my motivation to define a "palette" is NOT to emulate the C64 look on the PC, I was and will use it to convert 16.7 mio colors pictures to the 16 C64 colors. ;)
    Of course it can be used for emulators as well.

    IMHO you'd be better off to develop a series of test screens that will allow you to systematically visually create a good looking approximation. Real CRT screen right, your screen left, and move the sliders till it looks close enough.



    I actually did this in 2002 already. I had some touch point with ConGo. But using the GoDot palette, the converted pictures on my real C64 did not really look like the preconverted ones on the PC.

    Therefore, I created my own palette. At least for my hardware combination, it worked pretty neatly those days.

    Now almost 20 years later analysing that palette, most of the found colors frightening closely are matching the color angles that I think were Commodore's target colors.

    7 colors have 0.0° (!) deviation, 4 colors are within -2°...+9° deviation. Related to the 360° circle, that's a max. deviation of +2.5 percent.

  • I'd sleep well already at this point. :-D

    Yes, that was quite a precise landing, considering I did not know nothing about YUV color space or some possible target color angles that time.
    It is especially amazing when you consider mathop's even/odd measurements where the alternating lines have about 15°...17.5° deviation for the same color.;)

    Even the brightness match was not too bad. I did not know Pepto's magic 32 steps at that time or that there were 7 luminace pairs.

    Just during the palette creation, I arranged the colors according to their brightness and realized that there were two colors that had the same B/W value. Therefore, I had adjusted the brightness of those colors pairs in my palette as a next step. I used kind of average of the pair's brightness and some "nice", but arbitraryly set steps. I had no measured brightness results I could refer to, so that dose of random was my magic.:thumbsup:

    Thanks for explaining in detail! :-)

    You are welcome. Entertaining is also part of the motivation. I personally like to read such technical stuff like Marko, Pepto, Hitmen, ilesj, Kodiak64, mathop or Christopher JAM. So I hope it is at least a bit of fun to read and won't cost you too many precious hairs when you scratch your head. ;)

  • There probably are no correct values; the way I understand it is that the brightness is largely determined by the sync level, which for PAL is -300mV. I don't see any tolerance for that number in the standard (BT.1700), so I guess that voltage has to be more or less exact. In the c64 the voltage is not constant; it depends on the pull-up resistor in the modulator, which can vary. It depends on the resistance in the VIC chip itself, which is certainly not constant. Luma resistor values for 6569R3 appear to be very different from 6569R5, even though the layout of the traces on the chip is the same (as far as I can see.) Also there is a voltage drop across the diode and transistor in the modulator which has some effect. And then there's temperature, etc.

  • There probably are no correct values; the way I understand it is that the brightness is largely determined by the sync level, which for PAL is -300mV. I don't see any tolerance for that number in the standard (BT.1700), so I guess that voltage has to be more or less exact. In the c64 the voltage is not constant; it depends on the pull-up resistor in the modulator, which can vary. It depends on the resistance in the VIC chip itself, which is certainly not constant. Luma resistor values for 6569R3 appear to be very different from 6569R5, even though the layout of the traces on the chip is the same (as far as I can see.) Also there is a voltage drop across the diode and transistor in the modulator which has some effect. And then there's temperature, etc.

    You are talking about the brightness, right?
    How about the chrominance? From measurements, besides EVEN/ODD deviation, all colors do have the same sqrt(U²+V²) amount?

  • The color amplitude increases the more the color moves to a right angle (0/90/180/270), i.e. color burst will have the lowest amplitude, then orange/purple/green, then brown, and finally blue/yellow/red/cyan will have the greatest amplitude. In theory you could calculate the phase and amplitude if you know the resistor values for each color. The amplitudes don't match with the theory, probably because of this even/odd phase difference thing. E.g. the blue-to-burst ratio is about 1.17 on even lines and 1.30 on odd lines. Or the other way around, but certainly not constant.

  • The color amplitude increases the more the color moves to a right angle (0/90/180/270), i.e. color burst will have the lowest amplitude, then orange/purple/green, then brown, and finally blue/yellow/red/cyan will have the greatest amplitude. In theory you could calculate the phase and amplitude if you know the resistor values for each color. The amplitudes don't match with the theory, probably because of this even/odd phase difference thing. E.g. the blue-to-burst ratio is about 1.17 on even lines and 1.30 on odd lines. Or the other way around, but certainly not constant.

    In some of the analysis (e.g. post #44) of your palette that I posted, one could see that the even/odd lines oscilate in color amplitude depending on the (target) color angle. But even odd pairs seem to be somehow "mirrored" in the color amplitude.
    It means the average of both is more or less constant for all color angles. This is what I wanted to confirm.

  • I guess the average color amplitude is more or less the same for each color. It's rather difficult to tell, the color signal is all over the place. (I.e. it is not a well-behaved sine-like wave that moves neatly between two extremes.) Maybe the HMOS VIC-II has better color output since the color portion of that chip appears to have been altered slightly.

  • kein Interesse?

    Doch! This is already fascinating thread here! For some reasons *none* of the myriad of palettes available e. g. in Vice, looks "right" to me. I tend to switch between "pepto", "colodore" and "community" and all of them look wrong to me one way or another, depending on the case they're used in. I partially attribute this to two facts. One: values of the analogue signal generated by the 64 are by no means "legal" in terms of standards compliance. This potentially causes side-effects on the analogue CRT circuitry it's been typically fed to. I realised how important this might be once I passed the signal through a "legaliser" device and suddenly the real C64 output started to remind much more the "default" Vice palette. The one I always kept scratching my head and rhetorically asking where the h did they get this palette from... Two: Back then I kept my CRTs adjusted for a little less than typical brightness (black had to be *black* and not some [very] dark grey) and a little more than typical saturation, which e. g. the "pepto" palette very much lacks. Therefore I find this subject far from being closed and am happy to see more attempts at understanding it all better.

  • I guess the average color amplitude is more or less the same for each color. It's rather difficult to tell, the color signal is all over the place. (I.e. it is not a well-behaved sine-like wave that moves neatly between two extremes.) Maybe the HMOS VIC-II has better color output since the color portion of that chip appears to have been altered slightly.

    From checking several palettes and measurements like yours, it seems that all colors have a similar color amplitude, except: brown. Not scientifically proven, I would assume about 2/3 of the other colors' color amplitude for it.
    Maybe one reason why palettes look less vivid when all colors' amplitude was chosen not to get out of RGB gammut with the bown.
    Would love to see some measurements made with a C64C and 8565R2.:thumbsup:

    kein Interesse?

    Doch! This is already fascinating thread here! For some reasons *none* of the myriad of palettes available e. g. in Vice, looks "right" to me. I tend to switch between "pepto", "colodore" and "community" and all of them look wrong to me one way or another, depending on the case they're used in. I partially attribute this to two facts. One: values of the analogue signal generated by the 64 are by no means "legal" in terms of standards compliance. This potentially causes side-effects on the analogue CRT circuitry it's been typically fed to. I realised how important this might be once I passed the signal through a "legaliser" device and suddenly the real C64 output started to remind much more the "default" Vice palette. The one I always kept scratching my head and rhetorically asking where the h did they get this palette from... Two: Back then I kept my CRTs adjusted for a little less than typical brightness (black had to be *black* and not some [very] dark grey) and a little more than typical saturation, which e. g. the "pepto" palette very much lacks. Therefore I find this subject far from being closed and am happy to see more attempts at understanding it all better.

    Thanks. Glad that you like it. All of that is just based on the efforts that many others made since years and the measurements that they made. All that I am doing here basically is just some Google and Excel. ;)
    You can also see that I made some wrong assumptions at the start of this threat.:rolleyes: We just can learn and make it better together.;)
    Don't expect too dramatic color changes. The current ones are already quite matured. Maybe mainly it's just the understanding for the colors "source" that could get a bit sharper thanks to the measurements of e.g. Michiel.


    As a non-electrical guy, I agree with you that it is a miracle that we could ever see a picture coming out of the C64. It obviously had and has so many non-compliances: Refresh rate frequencies do not match, it is progressive and not interlace, separated video levels for colors are much too high (compared to the later standard), the other video levels also might only be somehow in the range of the standard.:saint:
    I had never had any issues with CRT monitors or TVs, both composite and spearate video (without using any resistors). But when using modern TVs, some do not show a picture at all any more, some do some quite strange things.

  • Don't expect too dramatic color changes

    I don't. The turning point for me was when I passed the signal through a studio-quality "legaliser", which brought the signal into PAL-legal ranges. It was an eye-opening moment. I realised that e.g. the "default" palette makes much more sense than I ever wanted to credit it with. This also told me that the reason why all of them look wrong one way or another may easily stem from the fact that the displays we used to watch the picture on, most probably distorted the output differently, depending on how they reacted to the out of specs signal being fed to them. True those analogue devices were much more forgiving for obvious reasons, but the problem was there all the time.

    Refresh rate frequencies do not match, it is progressive and not interlace, separated video levels for colors are much too high (compared to the later standard), the other video levels also might only be somehow in the range of the standar

    Yes. Some time ago I even started a project to insert a riser under the VIC in order to clean and "legalise" its output closest to the source. My main motivation back then was to allow most if not all current displays accept the C64 signal and produce correct picture out of it. After a rather long analysis I mostly ditched the approach. The "riser" concept got transformed into what is now called BeamRacer and only a few of the original ideas got implemented there (GreydotKilla and Lumafix Pro).

  • Would love to see some measurements made with a C64C and 8565R2

    Tell me what exactly you would like to have measured and I'll find a time slot to do it. Next to regular oscilloscopes and co. I am "somewhat"

    preview

    equipped to do video-specific measurements :-)

    I dunno what all of this is, but it looks pretty impressive.:thumbsup:

    So could you measure for each of the 16 colors (for composite and separate video outputs):

    brightness (voltage)
    color (U/V or at least color angle)
    Can you separte for even/odd lines?

    Test sample a stock PAL C64C with 8565R2 as I could not find any measurment in the net beyond 6569R5.
    You have that C64 hardware?
    Maybe it would be good to make the same measurements with a 6569R5 eqipped C64 to bias your results with ones previously done by others.