Jump to content

Talk:ZX Spectrum graphic modes: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
Restored revision 1094547774 by 4throck (talk): This is all very interesting, but it's not really for the talk page of a wiki article.
Line 47: Line 47:
</blockquote>
</blockquote>
[[User:Moroz1999|Moroz1999]] ([[User talk:Moroz1999|talk]]) 19:06, 12 April 2009 (UTC)
[[User:Moroz1999|Moroz1999]] ([[User talk:Moroz1999|talk]]) 19:06, 12 April 2009 (UTC)

:That's great, except that noone understands it except the Unreal Speccy. For us mere humans, please convert this result to sRGB. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 08:51, 9 November 2023 (UTC)
:Also, the linked discussion is in Russian, which makes it impossible to read.
:Also, if the linked article doesn't include a conversion of primary colors from BT.601 (PAL) to Rec.709 (sRGB), then the result must be flawed. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 09:08, 9 November 2023 (UTC)


== Too bright 'dim' RGB values suddenly – “PAL gamma”? ==
== Too bright 'dim' RGB values suddenly – “PAL gamma”? ==
Line 84: Line 80:
::The point here is that Wikipedia is a web based, and web colors are sRGB (unless you use images with ICC profiles...)
::The point here is that Wikipedia is a web based, and web colors are sRGB (unless you use images with ICC profiles...)
::Hope it helps [[User:4throck|4throck]] ([[User talk:4throck|talk]]) 08:57, 14 September 2021 (UTC)
::Hope it helps [[User:4throck|4throck]] ([[User talk:4throck|talk]]) 08:57, 14 September 2021 (UTC)

:You are both using incorrect calculations.
:If we assume the signal voltage amplitude of 85%, then on a PAL CRT with a gamma of 2.4, the luminance of the halfbright output color would be:
:pow(0.85, 2.4) = 0.677 = 67.7%
:When displaying on an sRGB-standard display, this would be a luminance with the index 215.
:Therefore, (215, 215, 215) is the halfbright white.
:Of course, this is all incorrect because it has to be recalculated to Rec.709 primaries, but they are somewhat close to PAL primaries, so the difference there is not large.
:Also, there is an assumprion that the original Spectrum hardware is actually able to produce the output signal that fully saturates the output colors, and this assumption is also likely false.
:So, the best way to get the actual colors is to connect an old Spectrum to an old PAL TV, and then to measure it with a colorimeter. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 07:06, 9 November 2023 (UTC)
::Correction - if you redo the calculation with the 75% voltage value, then you get (188,188,188) as halfbright white. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 07:11, 9 November 2023 (UTC)
::Since the currect article uses an obviously incorrect vaues, I'll edit it to the "205" in sRGB (#CDCDCD) as a compromise value.
::To get actual values, you have to measure the Spectrum's output signal on an oscilloscope, find out the voltage of full-brights and half-brights, verify that it can produce fully saturated U-V chromacities, and then re-compute it to Rec. 709 primaries. Then, confirm all this with a colorimeter on a standard PAL TV. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 07:50, 9 November 2023 (UTC)
::I recomputed it all to 81.4% voltage (0.529 V), which produces the half-bright at #CDCDCD (index 205) [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 08:41, 9 November 2023 (UTC)
::Under the assumption that some components of the ZX Spectrum hardware are performing their function perfectly, we can use the following computation to calculate the sRGB color values with the IEC 61966-2-1 primary colors:
::---- Let's convert a bright green to the sRGB color primaries:
::x = 0.29 (chromacity x of the green PAL phosphor)
::y = 0.60 (chromacity y of the green PAL phosphor)
::----- We have to set the CIE luminance Y value so that the brightest RGB component (green) equals 1:
::Y = 1 / 1.415106666;
::----- Now we compute the CIE 1931 X and Z coordinates:
::X = Y/y × x = 0.34155258051
::Z = Y/y × (1-x-y) = 0.12955442709
::R_linear_sRGB = +3.2406 × X - 1.5372 × Y - 0.4986 × Z = -0.04403908
::G_linear_sRGB = -0.9689 × X - 1.8758 × Y + 0.0415 × Z = 1.0
::B_linear_sRGB = -0.9689 × X - 1.8758 × Y + 0.0415 × Z = 0.01180476
::---- The R_linear_sRGB value is negative, so we clamp it to 0 (meaning that PAL BT.470 green color is outside the gamut of sRGB, so we select the nearest sRGB green color).
::---- Finally, we apply the sRGB gamma compression OETF:
::ZX Spectrum bright green in sRGB = (0, 255, 28) = #00FF1C
::----- For half-bright green, we simply use the pow( (0.55 V / 0.65 V), 2.8) = 62.64% of linear values:
::R_linear_sRGB = 0
::G_linear_sRGB = 0.6264
::B_linear_sRGB = 0.0073945
::---- Again, we apply the gamma compression:
::ZX Spectrum half-bright green in sRGB = (0, 207, 21) = #00CF15
::---- Now, a bright blue to the sRGB color primaries:
::x = 0.15 (chromacity x of the blue PAL phosphor)
::y = 0.06 (chromacity y of the blue PAL phosphor)
::Y = 1 / 13.85241667;
::----- Applying the same computation, we get the sRGB of blue colors:
::R_linear_sRGB = -0.0000433
::G_linear_sRGB = -0.0000024
::B_linear_sRGB = 1.0
::ZX Spectrum full-bright blue in sRGB = (0, 0, 255) = #0000FF
::ZX Spectrum half-bright blue in sRGB = (0, 0, 207) = #0000CF
::----- Now, a bright red to the sRGB color primaries:
::x = 0.64 (chromacity x of the red PAL phosphor)
::y = 0.33 (chromacity y of the red PAL phosphor)
::Y = 1 / 4.70227272;
::R_linear_sRGB = 1.0
::G_linear_sRGB = 0.00010504
::B_linear_sRGB = 0.00002449
::ZX Spectrum full-bright red in sRGB = (255, 0, 0) = #FF0000
::ZX Spectrum half-bright red in sRGB = (207, 0, 0) = #CF0000
::---- We conclude that only the PAL green phosphor is significantly out-of-gamut on sRGB displays.
::---- Now we can add up the linear sRGB intensities to produce other colors:
::ZX Spectrum full-bright magenta in sRGB = (255, 0, 255) = #FF00FF
::ZX Spectrum half-bright magenta in sRGB = (207, 0, 207) = #CF00CF
::ZX Spectrum full-bright cyan in sRGB = (28, 255, 255) = #1CFFFF
::ZX Spectrum half-bright cyan in sRGB = (21, 207, 207) = #15CFCF
::ZX Spectrum full-bright yellow in sRGB = (255, 255, 28) = #FFFF1C
::ZX Spectrum half-bright yellow in sRGB = (255, 255, 21) = #CFCF15
::----- DISCLAIMER: the entire above computation is valid only under the following assumptions:
::- the ZX Spectrum hardware is supplying the built-in LM1889 color modulator with fully saturated R-Y and B-Y voltages (possibly true)
::- the ZX Spectrum hardware is supplying the built-in LM1889 color modulator with proper and stable input reference voltages (likely false, especially because the LM1889 should be fed with the 15 V input instead of 12 V that ZX Spectrum provides)
::- the cheap built-in LM1889 color modulator can actually perform correct color modulation (likely false)
::- The built-in ASTEC UM1233 composite PAL coupler is not introducing any unwanted distortions (likely false)
::Overall, the overwhelming likelyhood is that ZX Spectrum's colors are much more gray-ish (less saturated) than the values produced by the above computation. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 19:55, 9 November 2023 (UTC)
::I have two copy-paste errors above, but all the computed values are correct:
:: G_linear_sRGB = -0.9689 * X + 1.8758 * Y + 0.0415 * Z;
:: B_linear_sRGB = +0.0557 * X - 0.2040 * Y + 1.0570 * Z;
::The second error:
::ZX Spectrum half-bright yellow in sRGB = (207, 207, 21) = #CFCF15 [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 20:03, 9 November 2023 (UTC)
::I forgot the half-bright white. It computes to:
::ZX Spectrum half-bright white in sRGB = (207, 207, 208) = #CFCFD0
::Apparently, the difference in chromacity between the sRGB green filter and the PAL green phosphor is sufficient to increase the value of blue index to 208. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 20:20, 9 November 2023 (UTC)
::I have found another small error in the computation above:
::The linear sRGB values of simulated red, green and blue phosphors have to add up to the value of 1, so that the D65 white point is preserved. However, they do not add up exactly to 1, but very close. The problem is that I oversimplified the computation of CIE Y coordinate. Fortunately, the error is small and the above computation is more accurate than any previous computation. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 20:57, 9 November 2023 (UTC)
::If I select the following CIE xyY coordinates to approximate the PAL bright green on sRGB, then I get a closer approximation than previously given:
::x = 0.298194
::y = 0.593493
::Y = 0.7159
::It computes to sRGB value (0,255,29) for bright green and (0,207,21) for half-bright green. But, then the bright blue should be (0,0,254) in order to add up to the exact D65 white point. Etc... Anyway, I think I'll levae a more accurate computation to others. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 21:59, 9 November 2023 (UTC)
::I have figured out what is causing the slight discrepancy in the computation. The PAL BT.470 standard gives CIE xy coordinates of the three primary phosphors, but does not directly specify their CIE luminance Y. However, it specifies the white point D65, which effectively tells us the actuall full luminance of each phosphor (that produces D65 white).
::Therefore, the lumunance Y of all three PAL phosphors needs to be computed first (so that all three phosphors at full intensity produce D65). It requires solving a 3x3 set of linear equations (there are several 3x3 matrix solvers online).
::The PAL green phosphor will probably have a luminance close to 0.715, so no major changes compared to the computation above.
::However, the blue phosphor will certailny have a lower luminance in PAL than in sRGB, because this is the only way to produce D65. Therefore, the sRGB color of PAL blue phosphor will likely be closer to (0,0,253). [[Special:Contributions/80.80.52.254|80.80.52.254]] ([[User talk:80.80.52.254|talk]]) 02:55, 11 November 2023 (UTC)
:Also, the sRGB standard doesn't use a gamma of 2.2 (or 2.4). Instead, it uses a composite transfer function, which is close to PAL gamma of 2.4. The standard sRGB composite transfer function was used in my recalculation to 81.4% voltage. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 09:22, 9 November 2023 (UTC)
::I have just figured out that I'v got the gamma of analog PAL systems wrong (it's not 2.4). The relevant gamma value of analog PAL systems is given in ITU-R BT.470-6. The value of gamma exponent equals 2.8.
::When recomputed to Spectrum's output voltage of 0.55 V = 0.84615%, it produces the sRGB index of 207 (#CFCFCF). I'm too tired to correct the article. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 11:03, 9 November 2023 (UTC)
::The analog PAL standard (BT.470) is the relevant standard for all color computations on ZX Spectrum. It uses the same color primaries as BT.601 (digital PAL), but the transfer function is different in digital PAL. On analog PAL, the gamma equals 2.8. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 11:21, 9 November 2023 (UTC)
::Well, at least the current value of #CDCDCD is much closer to the correct value #CFCFCF then what was given in the previous version of the article. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 11:37, 9 November 2023 (UTC)
:::You are correct about gamma 2.8. Keep in mind than you then have to reconvert the value to gamma 2.2 for sRGB... [[User:4throck|4throck]] ([[User talk:4throck|talk]]) 13:26, 9 November 2023 (UTC)
::::No, the sRGB doesn't use gamma 2.2
::::Instead, it uses a complex transfer function. That function was applied.
::::The complex sRGB gamma transfer function is actually honored in most modern LCD displays. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 13:56, 9 November 2023 (UTC)
:::::So, lets say you want to measure Spectrum's green color. You make the Spectrum produce an all-green screen. It will have a constant luma amplitude voltage, with a modulated color sub-carrier signal (a 4.3361875 MHz sine wave) added to it. You need to measure the amplitude of the color signal wave. Then, you also measure the phase-shift of that sine wave compared to the phase of the color-burst signal. That phase-shift will be different on the altentate lines of the signal ("PAL") by 180 degrees, so the actual phase shift must be calculated as the average of the phase shifts of two successive lines. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 15:04, 9 November 2023 (UTC)
:::More details: it is incorrect to refer to BT.709 standard in this article, because BT.709 is the standard for HDTV television. Instead, the relevant standard is sRGB (IEC 61966-2-1). The sRGB standard uses the same color primaries as the BT.709, which is the source of confusion.
:::To get actual sRGB values for ZX Spectrum, one needs to know the actual UV voltages that ZX Spectrum produces, where Umax = 0.463 V and Vmax = 0.615 V, according to the BT.470 analog PAL standard. Each of the Spectrum's 15 colors needs to be measured as UV voltages, and only from that data an accurate conversion to sRGB can be made. The values in the article are, obiously, only rough guesses, because Altwasser, the Spectrum's designer, couldn't have selected the chromacities of colors to match maximum values of the sRGB standard published 15 years later. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 13:53, 9 November 2023 (UTC)
:::I forgot to mention that the UV voltages are not directly measurable in the PAL TV signal. Instead, the UV voltages produce a phase-amplitude shift of the chroma sub-carrier, and that phase-aplitude-shift is measurable. From the phase-amplitude-shift, measured on an osciloscope, the UV voltages can be computed. [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 14:20, 9 November 2023 (UTC)
:::I've updated the page to use the #CFCFCF value, as the best-approximation given the incomplete data (UV voltages or the aplitude-phase shift of the chroma sub-carrier is required for more accurate computation). [[Special:Contributions/80.80.52.167|80.80.52.167]] ([[User talk:80.80.52.167|talk]]) 15:54, 9 November 2023 (UTC)
::::I don't have any problems with your values. Your conversion method seems logical and well documented, and #CFCFCF seems to agree with empirical evidence. [[User:4throck|4throck]] ([[User talk:4throck|talk]]) 10:38, 10 November 2023 (UTC)
:I have just figured out a really easy way to convert from PAL to sRGB primaries.
:This image contains PAL primaries:
:https://www.search.com.vn/wiki/en/File:RGB_primaries_-_BT.2020,_sRGB,_BT.709,_DCI-P3,_SMPTE-C,_NTSC_and_PAL.png
:You open that image in GIMP (relative colorimetric, with black point compensation), and blur the image a bit to get more consistent results. Then, simply use a color picker tool to get sRGB values of each of the three PAL primary colors.
:The sRGB values are:
:PAL red = sRGB(255,1,1) #FF0101
:PAL green = sRGB(0,255,28) #00FF1C
:PAL blue = sRGB(1,1,253) #0101FD
:From these values, all ZX Spectrum's colors can be easily computed.
:Of course, the method where each ZX Spectrum color is measured by PAL voltage level and the phase-amplitude shift of the PAL chroma sub-carrier (via UV volatges), would produce much more accurate and realistic results. Those actual colors of ZX Spectrum are likely to be much less saturated than the colors produced by directly converting the PAL phosphors to sRGB. [[Special:Contributions/80.80.52.174|80.80.52.174]] ([[User talk:80.80.52.174|talk]]) 03:33, 11 November 2023 (UTC)
::Let's compute this conversion of "theoretic" ZX Spectrum PAL colors into sRGB color space. They are "theoretic" because we are assuming the maximum possible saturation that a ZX Spectrum could possibly achieve on the PAL output. The real colors produced by a ZX Spectrum on the PAL output are probably less saturated. The real colors are currently unknown, and the only way to find them out is by an oscilloscope, via the UV voltages method (by measuring amplitude-phase shift of chroma sub-carrier).
::
::PAL red phosphor : sRGBlinear(100.00000%, 0.04856%, 0.01518%)
::PAL green phosphor: sRGBlinear( 0.00000%, 99.91080%, 1.18793%) (out-of-gamut)
::PAL blue phosphor : sRGBlinear( 0.04553%, 0.00607%, 98.49012%)
::The PAL phosphor colors in linear sRGB were produced by GIMP. They are relative colorimetric, but relative colorimetric conversion is not the goal (I would prefer absolute colorimetric). The point is that GIMP is giving us the closest sRGB color match for PAL phosphors (such that overall luminance is also preserved). Also note that GIMP is making a slight error, probably due to dithering, but the error is very small so we can ignore it.
::The PAL green phosphor is out-of-gamut on sRGB, so sRGB cannot exactly match all of the PAL colors. As the real ZX Spectrum colors are probably less saturated than this, the error in green phosphor, which is out-of-gamut, is mostly irrelevant.
::By adding up, component-wise, the linear primary PAL colors, we can produce all the bright ZX Spectrum colors in linear sRGB. Then we apply the sRGB gamma compression (by inverse EOTF) to get the final sRGB values:
::full-blue : sRGB( 2, 0, 253) #0200FD
::full-red : sRGB(255, 2, 1) #FF0201
::full-magen : sRGB(255, 2, 253) #FF02FD
::full-green : sRGB( 0, 255, 28) #00FF1C
::full-cyan : sRGB( 2, 255, 255) #02FFFF
::full-yello : sRGB(255, 255, 29) #FFFF1D
::full-white : sRGB(255, 255, 255) #FFFFFF
::Relative-vs-absolute colorimetric conversion is also irrelevant here, since it boils down to the same result (because sRGB gamut is very close to the PAL gamut). If the real ZX Spectrum colors were known, via UV voltages, then I would certainly prefer the absolute colorimetric conversion.
::From the PAL gamma exponent of 2.8, and the (possibly correct and assumed) half-brights voltage ratio of 0.55 V / 0.65 V, we get the linear luminance coefficient for half-brights: pow(0.55/0.65, 2.8) = 62.6409%. We apply this coefficient to linear full-bright colors. Finally, we apply sRGB gamma compression (by inverse EOTF) to get the half-brights in sRGB:
::half-blue : sRGB( 1, 0, 206) #0100CE
::half-red : sRGB(207, 1, 0) #CF0100
::half-magen : sRGB(207, 1, 206) #CF01CE
::half-green : sRGB( 0, 207, 21) #00CF15
::half-cyan : sRGB( 1, 207, 207) #01CFCF
::half-yello : sRGB(207, 207, 21) #CFCF15
::half-white : sRGB(207, 207, 207) #CFCFCF
::I would prefer if someone could confirm that this voltage ratio of 0.55 V / 0.65 V is actually valid for all the half-bright colors (and that all full-bright colors are at 0.65 V). The voltage can easily be different for different colors, so it should be measured for each of the 15 colors separately (not just for white), by an oscilloscope. Of course, the PAL signal of non-white colors will have a chroma sub-carrier added to it, so the white color is by far the easiest one to measure. The possible discrepancy in voltages for other colors can easily be caused by some ZX Spectrum's components, especially the color modulator LM1889. But, until better data is available, this is the best computation that can be done. [[Special:Contributions/80.80.52.99|80.80.52.99]] ([[User talk:80.80.52.99|talk]]) 15:41, 11 November 2023 (UTC)
:::I just got an idea about easily measuring the luminance level and the UV voltages.
:::An old ZX Spectrum needs to be connected to a PAL TV set. The idea is to use the PAL demodulator, which is built into the TV set, to measure luminance level and UV voltages half-directly, instead of measuring them in the PAL signal.
:::The PAL TV needs to be opened and the three electric traces have to be identified that carry the luminance level and the two UV voltages, after the initial demodulation. An oscilloscope is still required to measure the correct voltages, as the voltage level on those lines is likely to be periodically affected by the PAL synchronization signals.
:::The three voltage levels per each one of the 15 colors need to be measured.
:::This technique avoids any errors possibly caused by invalid saturation and brightnes settings of the TV set (as the colors will then be computed according to the PAL standard). Also, some TV manufacturers were adding fancy filters and oversaturation in image processing stages after the demodulation, which would all skew the correct voltages. [[Special:Contributions/80.80.52.11|80.80.52.11]] ([[User talk:80.80.52.11|talk]]) 16:28, 13 November 2023 (UTC)


== Grammar error near start of "ULAplus" section ==
== Grammar error near start of "ULAplus" section ==
Line 231: Line 86:


:: It means "if changes to the original hardware palette colours are slight". With ULAplus you can redefine the hardware palette completely. For example, you can change Black to Orange. Viewing such graphics on original hardware would look bad, as the displayed colour wouldn't match in any way. But small changes, for example Yellow to Orange, or Blue to Teal, would still look good on original hardware. The displayed colours wouldn't be too far off. Feel free to make the original sentence clearer! [[User:4throck|4throck]] ([[User talk:4throck|talk]]) 08:50, 23 June 2022 (UTC)
:: It means "if changes to the original hardware palette colours are slight". With ULAplus you can redefine the hardware palette completely. For example, you can change Black to Orange. Viewing such graphics on original hardware would look bad, as the displayed colour wouldn't match in any way. But small changes, for example Yellow to Orange, or Blue to Teal, would still look good on original hardware. The displayed colours wouldn't be too far off. Feel free to make the original sentence clearer! [[User:4throck|4throck]] ([[User talk:4throck|talk]]) 08:50, 23 June 2022 (UTC)

== Article split suggestion ==

In my opinion, the article should be split into two, because it is extremely confusing as it is. One article should be titled "ZX Spectrum Basic Graphics Mode", and the second article "ZX Spectrum Non-Basic Graphics Modes" (note: the split is not related to the BASIC programming language). The first article should contain everything up to the "Hicolour 8x1" section.

This second article can contain the descriptions of both the graphics modes of the ZX Spectrum's successors, and the various software-assisted modes, and other quirks that were used to enhance the output image. [[Special:Contributions/80.80.52.187|80.80.52.187]] ([[User talk:80.80.52.187|talk]]) 09:37, 12 November 2023 (UTC)

== How to simulate Spectrum's PAL output ==

Hello again!

I think I have found a way to faithfully simulate the output image of the ZX Spectrum on a PAL TV. Of course, different TV sets produce different images, so it can only be an approximation.

Descibed below is a much better approximation than the images currently displayed in the article. That's why I'm writing this, for anyone who has sufficient spare time, to use this procedure to produce a more realistic output images.

To convert an image, we will use GIMP. GIMP has an "indexed palette mode", available under main menu: Image -> Mode -> Indexed. GIMP can also manipulate the pallete, save and apply palettes, but the UI is not very intuitive, so I won't describe it here.

"ZX PAL-sim" procedure:

Step 1. Verify that the image uses 1:1 pixels. That means the size of the image is 256 × 192 (scr capture), or 320×240 (PC monitor-alike borders), or similar to 384×288 (original PAL border, but PAL TVs were actually slightly smaller, like 380×284). Most images look best with medium-size border, therefore 320×240 image with 256×192 pixel area.

Step 2. Verify that all the colours are correct according to the colour table provided in the article. Convert if necessary.

Step 3. Change the colour mode to RGB (Image -> Mode -> RGB)

Step 4. Change the precision to linear 32fp (Image -> Precision -> 32-bit fp)

Step 5. Triple the resolution, "NoHalo" interpolation (Image -> Scale Image). This will automatically add a lot of blur.

Step 6. Add "Gausian Blur", size 0.55 pixels (Filters -> Blur -> Gausian Blur). This adds just a bit more blur.

Step 7. Save the image (whether into png or jpeg format). It must have a triple resolution of the original, because otherwise blur couldn't be simulated well.

Done! You will also be able to notice that no current Speccy emulator does this well, unfortunately. The actual calculation, in code, is really simple, there is no need for complicated filters. [[Special:Contributions/80.80.52.125|80.80.52.125]] ([[User talk:80.80.52.125|talk]]) 19:22, 7 January 2024 (UTC)

:Note: Blur is extremely important.
:Even if the pallette is not 100% correct, this procedure will produce a much better image due to simulated blur.
:Once a correct pallette is created in GIMP, it is very easy to apply it to any image. [[Special:Contributions/80.80.52.125|80.80.52.125]] ([[User talk:80.80.52.125|talk]]) 19:33, 7 January 2024 (UTC)
::Here is Gimp palette (ZX-Spectrum.gpl) file, that you can use to apply the Spectrum's colour palette, as defined in the article. Just create a new empty text file and paste the following as contents, and then rename the file so that the extension is ".gpl".
::To import the palette in Gimp, use (Windows -> Dockable Dialogs-> Palettes, then the Palette Dialog opens, at the bottom is the "new palette button").
::To apply this palette to an image, first convert the image to RGB colour (Image -> Mode -> RGB). Then convert it to indexed colour with the given palette (Image -> Mode -> Indexed: Use custom palette: ZX-Spectrum.gpl, dithering: None, click Convert)
::<code>
::GIMP Palette
::Name: ZX Spectrum sRGB palette - relative colorimetric
::Columns: 16
::#
:: 0 0 0#0
:: 0 0 0#1
:: 1 0 206#2
:: 2 0 253#3
::207 1 0#4
::255 2 1#5
::255 2 253#6
::255 2 253#7
:: 0 207 21#8
:: 0 255 28#9
:: 1 207 207#10
:: 2 255 255#11
::207 207 21#12
::255 255 29#13
::207 207 207#14
::255 255 255#15
::</code> [[Special:Contributions/80.80.52.125|80.80.52.125]] ([[User talk:80.80.52.125|talk]]) 06:54, 8 January 2024 (UTC)
:::You can get much better quality images, especially the parrot image in the article, by simply applying the above palette to the original true-color parrot image, with Floyd-Steinberg (normal) dithering. Floyd-Steinberg is an error-diffusion dithering, which results in better quality then regular dithering of current article images.
:::Of course, Spectrum can't display an image generated in this way, so manual corrections for attribute cell rules, and then for pixels, are necessary.
:::Gradients should be especially easy to convert, as they require little manual intervention. [[Special:Contributions/80.80.52.125|80.80.52.125]] ([[User talk:80.80.52.125|talk]]) 07:28, 8 January 2024 (UTC)
::::Also note that Gimp is not applying Floyd-Steinberg dithering well, so an even better quality image can ge obtained by a custom algorithm, which could take into account both the sRGB gamma compression, and also use new formulas for quanifying perceptual color differences. [[Special:Contributions/80.80.52.125|80.80.52.125]] ([[User talk:80.80.52.125|talk]]) 07:33, 8 January 2024 (UTC)
:I think I have a small improvement of Step 6 (Gaussian Blur):
:In Gimp, this blur can be applied differentially on X and Y axis. So, better values would be:
:Size X: 0.66
:Size Y: 0.33 [[Special:Contributions/80.80.52.125|80.80.52.125]] ([[User talk:80.80.52.125|talk]]) 19:46, 7 January 2024 (UTC)
::Also note that if the original image size is 640×480 (e.g. it is a high-res mode or similar), then the procedure above cannot be employed because too many parameters need to be tweaked. [[Special:Contributions/80.80.52.125|80.80.52.125]] ([[User talk:80.80.52.125|talk]]) 20:08, 7 January 2024 (UTC)
:IMPORTANT highlight: the final image must have 3× the resolution of the original, otherwise blur can't be simulated well. [[Special:Contributions/80.80.52.125|80.80.52.125]] ([[User talk:80.80.52.125|talk]]) 19:58, 7 January 2024 (UTC)

Revision as of 07:49, 8 January 2024

WikiProject iconComputing Start‑class Mid‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
StartThis article has been rated as Start-class on Wikipedia's content assessment scale.
MidThis article has been rated as Mid-importance on the project's importance scale.

This information needs to be reviewed by someone who knows the ZX demo scene or has used any of these modes. I myself only have access to some image converters and emulators, and couldn't get much more information than what's here.

It would be good to sort out the proper names and machines on which they are avaliable as software or hardware supported modes.

Also, a list of graphic editors for each mode would be nice, along with some software that showcases its use. --Ricnun 15:55, 26 July 2006 (UTC)[reply]

Epilepsy?

I'm a bit worried about Image:Parrot rgb3.gif. I think it could give someone a fit, so a slower version would be better -- maybe with a link to the existing version, together with a warning? --StuartBrady (Talk) 22:30, 3 August 2006 (UTC)[reply]

  • I've replaced both of the flickering images with links and warnings. The W3C's guidelines on this are available here.--Fastfission 14:45, 4 August 2006 (UTC)[reply]
  • Good, looks fine to me. This "new" display modes do flicker a lot, even on a TV, so the GIFs really simulate the effect (50Hz flicker). I think a good solution is really to just keep the links. Slower gifs will not simulate the effect and still flicker a lot. This way people can see the simulated effect if they can and healht issues are prevented. Since I created and put the images here on the first place, I apologise for some possible inconvenience.
Sorry, I wasn't clear — the idea of using a slower version wasn't to simulate the effect, only to illustrate how the effect works. I should really have said "one or two frames per second". --StuartBrady (Talk) 19:45, 4 August 2006 (UTC)[reply]

Shock Megademo

User:Pak21 removed this sentence, citing Shock Megademo as a counter-example:

However, the Spectrum's processor is not fast enough to write to an entire row of attribute bytes in one scanline, so 8x1 attributes can only be achieved over half of the screen width.

Shock Megademo does not utilise 8x1 attributes. It uses 8x2 attributes on top of alternating paper and ink lines to achieve a different colour on each line; one colour per line equals two colours per 8x2 cell. Don't know if it's worth mentioning this particular example in the paragraph about 8x2... Slovakia 10:31, 28 February 2007 (UTC)[reply]

I kind of doubt that 8x1 mode could cover half of the screen width. For a 3.5MHz machine, one TV scanline takes 224 CPU clock periods (i.e. 64us) which is enough to change the color attributes for only 14 character blocks (112 pixels) using 14 LDI instructions (one of the quickest ways of copying blocks of memory) without adjusting the pointers back to the start of the hicolor zone (each execution of an LDI intruction takes 16 clock periods). In fact, David Webb propsed in "Advanced spectrum machine language" ([1]) a hicolour mode with a width of only 8 characters (64 pixels). I was able to extend this width to 11 or 12 character blocks (long time since then) by lengthening the code but this would be OR since I don't have anything published. However, if you'd use a single attribute byte per scanline, then yes, you could extend the hicolour zone to half of the screen width (or maybe more - again, David Webb has a full-screen horizon generator that changes the attributes for some 22 characters) but that wouldn't count anymore as 8x1 attributes.89.137.246.65 (talk) 21:48, 27 February 2011 (UTC)Apass[reply]

I rechecked the timmings and the Z80 instruction set and I guess, with enough RAM available during execution, it could be possible to change the attributes for about half a screen witdh on each scan line. For instance, a combination of LD HL,(Buffer); LD (ATT),HL; will take 26 t-states for 2 attributes, allowing for 16 bytes replaced during a scanline (and a timming sequence like 4 NOPs on each scanline) - however, the RAM needed for this would be quite large - 16 attribute bytes/scanline x 192 pixel rows x (1 byte/attribute in the Buffer zone + 3 bytes for LD HL,(Buffer) + 3 bytes for LD (ATT),HL) + 192*4 bytes for timing on each line, will make some 22272 bytes needed. Well, it could be done better than this using some tricks, but that's a new project for me :)89.137.246.65 (talk) 21:11, 28 February 2011 (UTC)Apass[reply]
I don't know what was wrong with me the other day... the instruction sequence would be, of course, LD HL,Attribute; LD (ATT),HL. And the amount of RAM would be 8x192x(3+3)+192x4=9984 bytes. I was off by a factor of 2.2 - I forgot that each intruction pair deals with two attributes, so only 8 pairs are needed to fill the 16 bytes per line and that each instruction contains all the attribute data needed, so the attribute table is not necessary...89.137.246.65 (talk) 21:26, 1 March 2011 (UTC)Apass[reply]

About the color palette section and the size of the thumbnails

Hello. I am the original writer of the section Color palette in the List of palettes article, ZX Spectrum section. I saw you have copy&pasted the section literally. I think that wikipedians must not to "copy-paste" between us! One of two: or the technical details must keep in this page and the color table keep in the palettes article with a link to the yours, or you should to put a simple paragraph (with your image, it's OK) and a link to the ZX Spectrum section of the "List of palettes" article.

Also, I think that the size you have put the sample thumbnails blurs the images (at least, in my PC) and the original effect is lost. A casual reader (and even an proffesional) will not note any difference between them. I think it's better to keep them at their original 256-width size.Ricardo Cancho Niemietz 20:05, 6 March 2007 (UTC)[reply]

I made the copy. Yes, it's a duplication and for me just some details and a link the Spectrum section on the palettes article is a good solution. Just like on other articles were you have "See main article". So that's fine for me.

As for the image size, good point. I formated the article for good layout out of experience. If the images are larger, someone will just edit and change their size. I've see this happen and really I don't have to time do keep reverting edits :-) Let me see if I can format this with 100% images and a good layout. Thanks for your input, I'll see to it when I have time if no one else does it first. Also, congratulations for the good job on the pallettes article ;-)Ricnun 00:31, 7 March 2007 (UTC)[reply]

I've changed the image sizes, let's hope nobody reverts them as this is pretty important. Moroz1999 (talk) 11:56, 17 February 2012 (UTC)[reply]

exact RGB values for palette.

The exact RGB values for the palette has been taken from the topic on ZX.PK.RU forum, where they have appeared as a result of a thorough discussion, hardware test and mathematic calculations.original topic (in russian)[2]

The mostly agreed result is on the 13th page (Unreal Speccy palette format):

pulsar=00,76,CD,E9,FF,9F:FF,00,00;00,FF,00;00,00,FF

Moroz1999 (talk) 19:06, 12 April 2009 (UTC)[reply]

Too bright 'dim' RGB values suddenly – “PAL gamma”?

I am quite worried after 4throck's « PAL gamma approximation » that has set 224 as potential RGB values for the dim colors, lately.


→ MY SUMMARY:

I am not convinced at all from this undocumented and rough method, so I'd like to know more about the applied conversion, in scientific terms hopefully. From what I humbly know as a long-term pixel artist and coder, almost all the related users on the real hardwares and via emulators are pretty fine with the medium 192, even the brighter 205 at times, for at least 14 years…


→ MY QUESTIONS:

  • What are the proofs of this sudden correction?
  • Where is the paper of this possible research?
  • Is your system original or modded?
  • What is your display and which settings?
  • Are you fine with these faulty dim colors?


→ MY DOUBTS:

  • The difference looks too big and new to be true.
  • The dimming looks flawed, not less inaccurate as expected.
  • We won't edit millions of RGB conversions after a one-man decision.
  • I remember my opposite experience here.

--dpla.fr 02:09, 13 September 2021 (UTC)

75% voltage (a linear value) corresponds to DN 192 of course, but that value was then PAL encoded and displayed on a CRT. That assumes a non-linear display gamma of 2.4. Today's displays are sRGB with gamma 2.2 (that's the web standard), so we need to change the values for proper display on Wikipedia. That's what I did, I simply gamma corrected the original value. Of course, I might have done a mistake somewhere. Feel free to apply a better correction or change it back, I'm not "territorial" about my contributions.
But one thing is certain, on an sRGB display the correct value won't be 192. Likewise the Spectrum's RGB primaries are BT.601 (PAL) and need to be converted to Rec.709 (sRGB) for accurate display. In practice the difference is minimal (ex: green will be something like 0,255,32 ), but mathematically it's there. So yes, all emulators are wrong unless you connect them to a PAL TV.
The point here is that Wikipedia is a web based, and web colors are sRGB (unless you use images with ICC profiles...)
Hope it helps 4throck (talk) 08:57, 14 September 2021 (UTC)[reply]

Grammar error near start of "ULAplus" section

"If only used to slight modify" does not make sense. I'd change it myself but I'm not completely sure it should be changed to "slightly" or if it's trying to say something else.

It means "if changes to the original hardware palette colours are slight". With ULAplus you can redefine the hardware palette completely. For example, you can change Black to Orange. Viewing such graphics on original hardware would look bad, as the displayed colour wouldn't match in any way. But small changes, for example Yellow to Orange, or Blue to Teal, would still look good on original hardware. The displayed colours wouldn't be too far off. Feel free to make the original sentence clearer! 4throck (talk) 08:50, 23 June 2022 (UTC)[reply]
🔥 Top keywords: Main PageSpecial:SearchIndian Premier LeagueWikipedia:Featured picturesPornhubUEFA Champions League2024 Indian Premier LeagueFallout (American TV series)Jontay PorterXXXTentacionAmar Singh ChamkilaFallout (series)Cloud seedingReal Madrid CFCleopatraRama NavamiRichard GaddDeaths in 2024Civil War (film)Shōgun (2024 miniseries)2024 Indian general electionJennifer PanO. J. SimpsonElla PurnellBaby ReindeerCaitlin ClarkLaverne CoxXXX (film series)Facebook2023–24 UEFA Champions LeagueYouTubeCandidates Tournament 2024InstagramList of European Cup and UEFA Champions League finalsJude BellinghamMichael Porter Jr.Andriy LuninCarlo AncelottiBade Miyan Chote Miyan (2024 film)