MPLAB® Harmony Graphics Suite > Designer > Microchip Aria Designer > MHGC Tools > Global Palette
MPLAB® Harmony Graphics Suite
Global Palette

The Global Palette window is launched from the Graphics Composer’s Asset pull-down menu. 

Using a Global Palette enables frame buffer compression for the LCC graphics controller. It creates a 256 color look up table (LUT) and then changes the entire user interface design to adhere to that LUT. Frame buffers are stored as 8 bits/pixel (bpp) indices rather than 16-32 bpp colors. The display driver performs a LUT operation to change each LUT index into a color before writing to the display/controller memory. This enables the use of double buffering, without using external memory, on devices that could not support it before. It also supports single buffering on larger displays. Of course, running the LUT requires more processing on the host. Currently only the LCC graphics controller supports this feature. The Aria demonstration Aria Basic Motion is an example of how using a Global Palette greatly improves the efficiency and capabilities of a design. 

Enable the Global Palette by clicking on the Enable Global Palette check box in the window or using the File > Settings > Color Settings menu. (The Global palette can always be disabled. MHGC will then restore the project back to its original configuration.) 

If the global palette is enabled here, you will have to check the "Enable Global Palette Mode?" in the Configuration Option for the Aria Graphics Library component in MHC's Project Graph:

 

The results of enabling the Global Palette:

  • 8bpp frame buffers. In the case of the most common demonstrations this means a 50% reduction in the size of the frame buffer.
  • This also opens up the capability to support a single frame buffer for some larger displays.

What is lost by enabling the Global Palette:

  • First and foremost - No Dynamic Colors. Dynamic colors are unlikely to match up with an entry in the global palette’s look-up table.
  • No alpha blending capability. The level of alpha blending can be changed during run-time. (See No Dynamic Colors.)
  • No JPEGs or PNGs. Again, no dynamic colors. All images in MGHC will be changed to the color mode of the project, and generated as Raw.
  • No font anti-aliasing. Again, no dynamic colors. While the 8-bits/pixel for each glyph is known, the color of the text depends on the color scheme used, and color schemes can change at run time.
  • Additional overhead when performing LUT (index->color) operations in the display driver.

The following figure shows the default “Global Palette” when Project Color Mode is set to RGB_888.

 

This default palette is good for designs that use a wide array of colors. MHGC also supports developing a custom palette by importing an image defining the palette or by analyzing the pixel colors already in use by the application’s images. The palette’s color mode is determined by the Project Color Mode, which is determined by the graphics controller. 

Clicking on an entry in the palette with bring up the Color Picker dialog window, allowing you to edit the entry’s color.

Window Toolbar

There are four icons on the toolbar:

  1. Import From Image File - Importing a global palette from an image file. Selecting this brings up the following warning. Images can be imported as a BMP,.GIF, JPEG, and PNG (but not TIFF).

 

 

  1. Auto-Calculate Palette – Calculates a new palette using the current design. Selecting this brings up the following warning.

 

 

  • Selecting Yes opens a status window that shows the progress made in selecting a palette of 256 colors

 

 

  • This can be lengthy operation, but it will effectively generate a palette better tailored to the design. However, extreme (or rare) colors will be changed to nearby, more-plentiful colors, thereby eliminating some of the contrast in images. Whites will tend to darken and blacks lighten. This can be remedied by editing the calculated palette to whiten the whites, darken the blacks, and make other colors closer to the original. This of course may increase the posterization of the image, but that is a natural trade-off in using only 256 colors.
  1. Reset to Default – This returns the Global Palette to its default values, which opens the Reset Global Palette dialog.

 

 

  1. Enable Global Palette – This performs the same function as File > Settings: Using a Global Palette. Selecting this opens the Enable Global Palette Mode warning.

MPLAB® Harmony Graphics Suite