The tutorial explains the process of converting common image files into a list of pixel values. Your E100 program will then have to read the pixel values and write them to the VGA monitor. There are two ways to provide the image data to your E100 program. For small images, you can convert the pixel values to an array of E100 assembly-language .data lines. Larger images won't fit in E100 memory, so your program will need to read the image data from an SD card.
To reduce the memory needed to store an image, use small images, or use a packed image encoding. This tutorial describes how to export very small images for use by an E100 assembly program. A packed encoding stores each pixel in less than one word. For monochromatic images, we can store sixteen pixels in a single word. This tutorial does not describe techniques for creating a packed encoding; that is left up to the reader.
If you need to store bigger images, you can use the SDRAM. The SDRAM can be initialized by copying data from an SD card.
We recommend you use the program KolourPaint to save the image. Start KolourPaint on Linux by running the application kolourpaint. Any imaging program will work, but KolourPaint provides an option to save an image as monochrome. In many cases, you will not need color information for the image, so saving it in monochrome makes the image data easier to understand and manage.
Here is a screenshot of kolourpaint. You can draw an image or open an image file from another source. You can resize the image by dragging the handle in the lower right corner, or using the menus: Selection -> Resize/Scale....
To make the image monochrome, click Selection -> More Effects.... This will produce the image effects dialog (screenshot). Then, from the Effects drop-down menu, select Reduce Colors. You can change the image to Monochrome or Monochrome (Dithered) (screenshot). Dithering is another technique to reduce the number of colors.
Finally, save the image using File -> Save As.... For Filter type, select BMP Image, and for Convert to, select Monochrome (screenshot). In this tutorial, we'll save the image as note.bmp.
Another useful drawing program on Linux is KIconEdit. KIconEdit works well for drawing small low-resolution images (e.g., fonts). Start KIconEdit on Linux by running the application kiconedit. Here is a screenshot of kiconedit. To save the image, click File -> Save As. For Filter, select BMP Image.
MATLAB can be started by running the program matlab. The right side of the MATLAB window allows you to enter commands. To change to the directory/folder your image was saved in, you can type cd followed by the directory name, just as you would at a terminal.
The following Matlab script can convert color images into a binary file appropriate for the SD card. Each word in the file is a proper VGA color for the E100, so it can be sent directly to vga_color_write. The output starts at the upper left of the image and sweeps across a row, then goes to the next row, eventually reaching the lower right corner of the image.
To use it, run the Matlab script and specify an 640 x 480 image file. It
can take up to a minute to process a full-screen image. If the script gives
an error about palettized images, try converting the image to PNG24 or BMP
format. The output .bin file can be used as the SD card input if you are
using code that will draw an image of the correct size using the SD card
data.
The E100 VGA controller supports a color palette with only 64 colors: 4
intensities for each of red, green, and blue. This small color palette
makes it difficult to faithfully represent full-color images on the E100.
The simplest approach is to round each color in the image to the nearest
color in the E100 palette, but this can lead to loss of detail and ugly
pictures.
A technique called
dithering
can help improve how full-color images look on the E100. Dithering alters
the color of neighboring pixels to make a richer range of colors appear to
the human eye, when viewed from a distance, due to the mixing of the colors
of nearby pixels by the human eye.
This tutorial describes how to use Adobe Photoshop to create a dithered
image that uses the E100 color palette.
The first step is to create a Photoshop color palette with the colors
supported by the E100. To do this, we need an image that contains the
64 colors supported by the E100.
Your dithered image has been created. Now your Matlab code to read the
color image data will not have to truncate or round any of the color
intensity values since the dithering has assigned only exact colors from
the E100 palette to be included in the pixels of the image.
Improving image quality with dithering
Creating a color palette for the E100

Applying dithering to an image