How does Apple ][gs hardware dithering work?












14














I haven't been able to find an easily comprehensible description of the super hi-res, dithered 16-color, 640x200 mode of the Apple ][gs.



I can tell from the references I did locate, this is a hardware supported mode of the VGC. So, the dithering effect is done in the hardware, not via software.



It seems that only 2 bits-per-pixel are used to create the sixteen colors on screen, but some of the colors aren't dithered (text foreground and background, for instance).



How does this work, how do you program it, and what are the limitations on palettes and adjacent pixels?










share|improve this question



























    14














    I haven't been able to find an easily comprehensible description of the super hi-res, dithered 16-color, 640x200 mode of the Apple ][gs.



    I can tell from the references I did locate, this is a hardware supported mode of the VGC. So, the dithering effect is done in the hardware, not via software.



    It seems that only 2 bits-per-pixel are used to create the sixteen colors on screen, but some of the colors aren't dithered (text foreground and background, for instance).



    How does this work, how do you program it, and what are the limitations on palettes and adjacent pixels?










    share|improve this question

























      14












      14








      14


      1





      I haven't been able to find an easily comprehensible description of the super hi-res, dithered 16-color, 640x200 mode of the Apple ][gs.



      I can tell from the references I did locate, this is a hardware supported mode of the VGC. So, the dithering effect is done in the hardware, not via software.



      It seems that only 2 bits-per-pixel are used to create the sixteen colors on screen, but some of the colors aren't dithered (text foreground and background, for instance).



      How does this work, how do you program it, and what are the limitations on palettes and adjacent pixels?










      share|improve this question













      I haven't been able to find an easily comprehensible description of the super hi-res, dithered 16-color, 640x200 mode of the Apple ][gs.



      I can tell from the references I did locate, this is a hardware supported mode of the VGC. So, the dithering effect is done in the hardware, not via software.



      It seems that only 2 bits-per-pixel are used to create the sixteen colors on screen, but some of the colors aren't dithered (text foreground and background, for instance).



      How does this work, how do you program it, and what are the limitations on palettes and adjacent pixels?







      graphics apple-iigs color-display dithering






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 25 at 23:06









      Brian H

      16.9k60140




      16.9k60140






















          1 Answer
          1






          active

          oldest

          votes


















          9














          The Apple IIgs Hardware reference explains it:




          In 640-pixel mode, color selection is more complicated. The 640 pixels in each horizontal line occupy 160 adjacent bytes of memory, each byte representing 4 pixels that appear side-by-side on the screen. The 16 colors in the palette are divided into four groups of 4 colors each. The first pixel in each horizontal line can select one of 4 colors from the third group of 4 in the palette. The second pixel selects from the fourth group of 4 colors in the palette. The third pixel selects from the first group of 4 colors, and the fourth pixel selects from the second group, as shown in Table 4-21. The process repeats for each successive group of 4 pixels in a horizontal line. Thus, even though a given pixel can be one of 4 colors, different pixels in a line can take on any of the 16 colors in a palette.




          ------------------------------------------------------
          Palette Palette
          Pixel Value color Pixel Value color
          ------------------------------------------------------
          3 0 0 1 0 8
          1 1 1 9
          2 2 2 10
          3 3 3 11
          4 0 4 2 0 12
          1 5 1 13
          2 6 2 14
          3 7 3 15


          The Apple IIgs Toolbox Reference Volume II explains the standard 640 mode palette:



          ------------------------------------------------------------------------
          Minipalette Minipalette
          Offset Color Value offset Offset Color Value offset
          ------------------------------------------------------------------------
          0 Black 000 0 8 Black 000 0
          1 Blue 00F 1 9 Blue 00F 1
          2 Yellow FF0 2 10 Yellow FF0 2
          3 White FFF 3 11 White FFF 3
          4 Black 000 0 12 Black 000 0
          5 Red D00 1 13 Red D00 1
          6 Green 0E0 2 14 Green 0E0 2
          7 White FFF 3 15 White FFF 3



          Note: The entries in the minipalettes for the standard 640-mode color table are set up so black and white appear in the same positions in each palette. This provides pure black and white at full 640 resolution, allowing crisper text display.




          The standard color dither together to form these 16 colors:



          ------------------------------
          Pixel Dithered
          value Name components
          -------------------------------
          0 Black black, black
          1 Dark blue black, blue
          2 Olive black, yellow
          3 Grey1 black, white
          4 Red red, black
          5 Purple red, blue
          6 Orange red, yellow
          7 Pink red, white
          8 Green green, black
          9 Aquamarine green, blue
          10 Lime green green, yellow
          11 Light green green, white
          12 Grey2 white, black
          13 Cornflower blue white, blue
          14 Light yellow white, yellow
          15 White white, white


          Dithered colorsDithered colors, enlarged



          To summarize, 320 mode uses a palette of 16 colors. 640 mode splits it up into 4 mini palettes of 4 colors. The palette used is based on the pixel position. With dithering, you can pretend to have 16 colors (but at a 320 resolution). With the standard desktop colors, black and white are available in all 4 mini palettes so they are available at any pixel for true 640 resolution.






          share|improve this answer























          • I only count a total of 6 unique colors in the 16 color "Minipalette".
            – Brian H
            Nov 26 at 1:12






          • 3




            The given set of colors is chosen to allow arbitrary black and white pictures to be displayed with 640x200 resolution, and allow any pictures that can be shown at all to be relocated to any even pixel boundary. The design allows programmers to trade resolution for color in whatever way is most useful.
            – supercat
            Nov 26 at 1:37










          • I'm also seeing a 17th colour; a light grey appearing at the intersections between each 2x2 grid of colours
            – bodgit
            Nov 26 at 14:48










          • @bodgit that's an optical illusion. See en.wikipedia.org/wiki/Grid_illusion
            – RETRAC
            Nov 26 at 19:53













          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "648"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          noCode: true, onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f8382%2fhow-does-apple-gs-hardware-dithering-work%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          9














          The Apple IIgs Hardware reference explains it:




          In 640-pixel mode, color selection is more complicated. The 640 pixels in each horizontal line occupy 160 adjacent bytes of memory, each byte representing 4 pixels that appear side-by-side on the screen. The 16 colors in the palette are divided into four groups of 4 colors each. The first pixel in each horizontal line can select one of 4 colors from the third group of 4 in the palette. The second pixel selects from the fourth group of 4 colors in the palette. The third pixel selects from the first group of 4 colors, and the fourth pixel selects from the second group, as shown in Table 4-21. The process repeats for each successive group of 4 pixels in a horizontal line. Thus, even though a given pixel can be one of 4 colors, different pixels in a line can take on any of the 16 colors in a palette.




          ------------------------------------------------------
          Palette Palette
          Pixel Value color Pixel Value color
          ------------------------------------------------------
          3 0 0 1 0 8
          1 1 1 9
          2 2 2 10
          3 3 3 11
          4 0 4 2 0 12
          1 5 1 13
          2 6 2 14
          3 7 3 15


          The Apple IIgs Toolbox Reference Volume II explains the standard 640 mode palette:



          ------------------------------------------------------------------------
          Minipalette Minipalette
          Offset Color Value offset Offset Color Value offset
          ------------------------------------------------------------------------
          0 Black 000 0 8 Black 000 0
          1 Blue 00F 1 9 Blue 00F 1
          2 Yellow FF0 2 10 Yellow FF0 2
          3 White FFF 3 11 White FFF 3
          4 Black 000 0 12 Black 000 0
          5 Red D00 1 13 Red D00 1
          6 Green 0E0 2 14 Green 0E0 2
          7 White FFF 3 15 White FFF 3



          Note: The entries in the minipalettes for the standard 640-mode color table are set up so black and white appear in the same positions in each palette. This provides pure black and white at full 640 resolution, allowing crisper text display.




          The standard color dither together to form these 16 colors:



          ------------------------------
          Pixel Dithered
          value Name components
          -------------------------------
          0 Black black, black
          1 Dark blue black, blue
          2 Olive black, yellow
          3 Grey1 black, white
          4 Red red, black
          5 Purple red, blue
          6 Orange red, yellow
          7 Pink red, white
          8 Green green, black
          9 Aquamarine green, blue
          10 Lime green green, yellow
          11 Light green green, white
          12 Grey2 white, black
          13 Cornflower blue white, blue
          14 Light yellow white, yellow
          15 White white, white


          Dithered colorsDithered colors, enlarged



          To summarize, 320 mode uses a palette of 16 colors. 640 mode splits it up into 4 mini palettes of 4 colors. The palette used is based on the pixel position. With dithering, you can pretend to have 16 colors (but at a 320 resolution). With the standard desktop colors, black and white are available in all 4 mini palettes so they are available at any pixel for true 640 resolution.






          share|improve this answer























          • I only count a total of 6 unique colors in the 16 color "Minipalette".
            – Brian H
            Nov 26 at 1:12






          • 3




            The given set of colors is chosen to allow arbitrary black and white pictures to be displayed with 640x200 resolution, and allow any pictures that can be shown at all to be relocated to any even pixel boundary. The design allows programmers to trade resolution for color in whatever way is most useful.
            – supercat
            Nov 26 at 1:37










          • I'm also seeing a 17th colour; a light grey appearing at the intersections between each 2x2 grid of colours
            – bodgit
            Nov 26 at 14:48










          • @bodgit that's an optical illusion. See en.wikipedia.org/wiki/Grid_illusion
            – RETRAC
            Nov 26 at 19:53


















          9














          The Apple IIgs Hardware reference explains it:




          In 640-pixel mode, color selection is more complicated. The 640 pixels in each horizontal line occupy 160 adjacent bytes of memory, each byte representing 4 pixels that appear side-by-side on the screen. The 16 colors in the palette are divided into four groups of 4 colors each. The first pixel in each horizontal line can select one of 4 colors from the third group of 4 in the palette. The second pixel selects from the fourth group of 4 colors in the palette. The third pixel selects from the first group of 4 colors, and the fourth pixel selects from the second group, as shown in Table 4-21. The process repeats for each successive group of 4 pixels in a horizontal line. Thus, even though a given pixel can be one of 4 colors, different pixels in a line can take on any of the 16 colors in a palette.




          ------------------------------------------------------
          Palette Palette
          Pixel Value color Pixel Value color
          ------------------------------------------------------
          3 0 0 1 0 8
          1 1 1 9
          2 2 2 10
          3 3 3 11
          4 0 4 2 0 12
          1 5 1 13
          2 6 2 14
          3 7 3 15


          The Apple IIgs Toolbox Reference Volume II explains the standard 640 mode palette:



          ------------------------------------------------------------------------
          Minipalette Minipalette
          Offset Color Value offset Offset Color Value offset
          ------------------------------------------------------------------------
          0 Black 000 0 8 Black 000 0
          1 Blue 00F 1 9 Blue 00F 1
          2 Yellow FF0 2 10 Yellow FF0 2
          3 White FFF 3 11 White FFF 3
          4 Black 000 0 12 Black 000 0
          5 Red D00 1 13 Red D00 1
          6 Green 0E0 2 14 Green 0E0 2
          7 White FFF 3 15 White FFF 3



          Note: The entries in the minipalettes for the standard 640-mode color table are set up so black and white appear in the same positions in each palette. This provides pure black and white at full 640 resolution, allowing crisper text display.




          The standard color dither together to form these 16 colors:



          ------------------------------
          Pixel Dithered
          value Name components
          -------------------------------
          0 Black black, black
          1 Dark blue black, blue
          2 Olive black, yellow
          3 Grey1 black, white
          4 Red red, black
          5 Purple red, blue
          6 Orange red, yellow
          7 Pink red, white
          8 Green green, black
          9 Aquamarine green, blue
          10 Lime green green, yellow
          11 Light green green, white
          12 Grey2 white, black
          13 Cornflower blue white, blue
          14 Light yellow white, yellow
          15 White white, white


          Dithered colorsDithered colors, enlarged



          To summarize, 320 mode uses a palette of 16 colors. 640 mode splits it up into 4 mini palettes of 4 colors. The palette used is based on the pixel position. With dithering, you can pretend to have 16 colors (but at a 320 resolution). With the standard desktop colors, black and white are available in all 4 mini palettes so they are available at any pixel for true 640 resolution.






          share|improve this answer























          • I only count a total of 6 unique colors in the 16 color "Minipalette".
            – Brian H
            Nov 26 at 1:12






          • 3




            The given set of colors is chosen to allow arbitrary black and white pictures to be displayed with 640x200 resolution, and allow any pictures that can be shown at all to be relocated to any even pixel boundary. The design allows programmers to trade resolution for color in whatever way is most useful.
            – supercat
            Nov 26 at 1:37










          • I'm also seeing a 17th colour; a light grey appearing at the intersections between each 2x2 grid of colours
            – bodgit
            Nov 26 at 14:48










          • @bodgit that's an optical illusion. See en.wikipedia.org/wiki/Grid_illusion
            – RETRAC
            Nov 26 at 19:53
















          9












          9








          9






          The Apple IIgs Hardware reference explains it:




          In 640-pixel mode, color selection is more complicated. The 640 pixels in each horizontal line occupy 160 adjacent bytes of memory, each byte representing 4 pixels that appear side-by-side on the screen. The 16 colors in the palette are divided into four groups of 4 colors each. The first pixel in each horizontal line can select one of 4 colors from the third group of 4 in the palette. The second pixel selects from the fourth group of 4 colors in the palette. The third pixel selects from the first group of 4 colors, and the fourth pixel selects from the second group, as shown in Table 4-21. The process repeats for each successive group of 4 pixels in a horizontal line. Thus, even though a given pixel can be one of 4 colors, different pixels in a line can take on any of the 16 colors in a palette.




          ------------------------------------------------------
          Palette Palette
          Pixel Value color Pixel Value color
          ------------------------------------------------------
          3 0 0 1 0 8
          1 1 1 9
          2 2 2 10
          3 3 3 11
          4 0 4 2 0 12
          1 5 1 13
          2 6 2 14
          3 7 3 15


          The Apple IIgs Toolbox Reference Volume II explains the standard 640 mode palette:



          ------------------------------------------------------------------------
          Minipalette Minipalette
          Offset Color Value offset Offset Color Value offset
          ------------------------------------------------------------------------
          0 Black 000 0 8 Black 000 0
          1 Blue 00F 1 9 Blue 00F 1
          2 Yellow FF0 2 10 Yellow FF0 2
          3 White FFF 3 11 White FFF 3
          4 Black 000 0 12 Black 000 0
          5 Red D00 1 13 Red D00 1
          6 Green 0E0 2 14 Green 0E0 2
          7 White FFF 3 15 White FFF 3



          Note: The entries in the minipalettes for the standard 640-mode color table are set up so black and white appear in the same positions in each palette. This provides pure black and white at full 640 resolution, allowing crisper text display.




          The standard color dither together to form these 16 colors:



          ------------------------------
          Pixel Dithered
          value Name components
          -------------------------------
          0 Black black, black
          1 Dark blue black, blue
          2 Olive black, yellow
          3 Grey1 black, white
          4 Red red, black
          5 Purple red, blue
          6 Orange red, yellow
          7 Pink red, white
          8 Green green, black
          9 Aquamarine green, blue
          10 Lime green green, yellow
          11 Light green green, white
          12 Grey2 white, black
          13 Cornflower blue white, blue
          14 Light yellow white, yellow
          15 White white, white


          Dithered colorsDithered colors, enlarged



          To summarize, 320 mode uses a palette of 16 colors. 640 mode splits it up into 4 mini palettes of 4 colors. The palette used is based on the pixel position. With dithering, you can pretend to have 16 colors (but at a 320 resolution). With the standard desktop colors, black and white are available in all 4 mini palettes so they are available at any pixel for true 640 resolution.






          share|improve this answer














          The Apple IIgs Hardware reference explains it:




          In 640-pixel mode, color selection is more complicated. The 640 pixels in each horizontal line occupy 160 adjacent bytes of memory, each byte representing 4 pixels that appear side-by-side on the screen. The 16 colors in the palette are divided into four groups of 4 colors each. The first pixel in each horizontal line can select one of 4 colors from the third group of 4 in the palette. The second pixel selects from the fourth group of 4 colors in the palette. The third pixel selects from the first group of 4 colors, and the fourth pixel selects from the second group, as shown in Table 4-21. The process repeats for each successive group of 4 pixels in a horizontal line. Thus, even though a given pixel can be one of 4 colors, different pixels in a line can take on any of the 16 colors in a palette.




          ------------------------------------------------------
          Palette Palette
          Pixel Value color Pixel Value color
          ------------------------------------------------------
          3 0 0 1 0 8
          1 1 1 9
          2 2 2 10
          3 3 3 11
          4 0 4 2 0 12
          1 5 1 13
          2 6 2 14
          3 7 3 15


          The Apple IIgs Toolbox Reference Volume II explains the standard 640 mode palette:



          ------------------------------------------------------------------------
          Minipalette Minipalette
          Offset Color Value offset Offset Color Value offset
          ------------------------------------------------------------------------
          0 Black 000 0 8 Black 000 0
          1 Blue 00F 1 9 Blue 00F 1
          2 Yellow FF0 2 10 Yellow FF0 2
          3 White FFF 3 11 White FFF 3
          4 Black 000 0 12 Black 000 0
          5 Red D00 1 13 Red D00 1
          6 Green 0E0 2 14 Green 0E0 2
          7 White FFF 3 15 White FFF 3



          Note: The entries in the minipalettes for the standard 640-mode color table are set up so black and white appear in the same positions in each palette. This provides pure black and white at full 640 resolution, allowing crisper text display.




          The standard color dither together to form these 16 colors:



          ------------------------------
          Pixel Dithered
          value Name components
          -------------------------------
          0 Black black, black
          1 Dark blue black, blue
          2 Olive black, yellow
          3 Grey1 black, white
          4 Red red, black
          5 Purple red, blue
          6 Orange red, yellow
          7 Pink red, white
          8 Green green, black
          9 Aquamarine green, blue
          10 Lime green green, yellow
          11 Light green green, white
          12 Grey2 white, black
          13 Cornflower blue white, blue
          14 Light yellow white, yellow
          15 White white, white


          Dithered colorsDithered colors, enlarged



          To summarize, 320 mode uses a palette of 16 colors. 640 mode splits it up into 4 mini palettes of 4 colors. The palette used is based on the pixel position. With dithering, you can pretend to have 16 colors (but at a 320 resolution). With the standard desktop colors, black and white are available in all 4 mini palettes so they are available at any pixel for true 640 resolution.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 26 at 4:14

























          answered Nov 26 at 0:52









          Kelvin Sherlock

          48828




          48828












          • I only count a total of 6 unique colors in the 16 color "Minipalette".
            – Brian H
            Nov 26 at 1:12






          • 3




            The given set of colors is chosen to allow arbitrary black and white pictures to be displayed with 640x200 resolution, and allow any pictures that can be shown at all to be relocated to any even pixel boundary. The design allows programmers to trade resolution for color in whatever way is most useful.
            – supercat
            Nov 26 at 1:37










          • I'm also seeing a 17th colour; a light grey appearing at the intersections between each 2x2 grid of colours
            – bodgit
            Nov 26 at 14:48










          • @bodgit that's an optical illusion. See en.wikipedia.org/wiki/Grid_illusion
            – RETRAC
            Nov 26 at 19:53




















          • I only count a total of 6 unique colors in the 16 color "Minipalette".
            – Brian H
            Nov 26 at 1:12






          • 3




            The given set of colors is chosen to allow arbitrary black and white pictures to be displayed with 640x200 resolution, and allow any pictures that can be shown at all to be relocated to any even pixel boundary. The design allows programmers to trade resolution for color in whatever way is most useful.
            – supercat
            Nov 26 at 1:37










          • I'm also seeing a 17th colour; a light grey appearing at the intersections between each 2x2 grid of colours
            – bodgit
            Nov 26 at 14:48










          • @bodgit that's an optical illusion. See en.wikipedia.org/wiki/Grid_illusion
            – RETRAC
            Nov 26 at 19:53


















          I only count a total of 6 unique colors in the 16 color "Minipalette".
          – Brian H
          Nov 26 at 1:12




          I only count a total of 6 unique colors in the 16 color "Minipalette".
          – Brian H
          Nov 26 at 1:12




          3




          3




          The given set of colors is chosen to allow arbitrary black and white pictures to be displayed with 640x200 resolution, and allow any pictures that can be shown at all to be relocated to any even pixel boundary. The design allows programmers to trade resolution for color in whatever way is most useful.
          – supercat
          Nov 26 at 1:37




          The given set of colors is chosen to allow arbitrary black and white pictures to be displayed with 640x200 resolution, and allow any pictures that can be shown at all to be relocated to any even pixel boundary. The design allows programmers to trade resolution for color in whatever way is most useful.
          – supercat
          Nov 26 at 1:37












          I'm also seeing a 17th colour; a light grey appearing at the intersections between each 2x2 grid of colours
          – bodgit
          Nov 26 at 14:48




          I'm also seeing a 17th colour; a light grey appearing at the intersections between each 2x2 grid of colours
          – bodgit
          Nov 26 at 14:48












          @bodgit that's an optical illusion. See en.wikipedia.org/wiki/Grid_illusion
          – RETRAC
          Nov 26 at 19:53






          @bodgit that's an optical illusion. See en.wikipedia.org/wiki/Grid_illusion
          – RETRAC
          Nov 26 at 19:53




















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Retrocomputing Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fretrocomputing.stackexchange.com%2fquestions%2f8382%2fhow-does-apple-gs-hardware-dithering-work%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How do I know what Microsoft account the skydrive app is syncing to?

          When does type information flow backwards in C++?

          Grease: Live!