Wednesday, October 1, 2008

Create your own personalized boot splash backgrounds for GRUB

The default GRUB bootloader screen is rather bland, but you can spice it up a little by creating your own custom graphical background screen for the bootloader.
GRUB imposes a number of limitations on the image size and number of colors. It also doesn't let you move the menu. The menu appears in a rectangle near the top of the screen, with some text instructions below the menu. This makes it relatively easy to create a graphical background screen for the GRUB bootloader, because you can focus primarily on making the bottom one-third of the screen interesting. That is not to say you cannot use other areas of the screen, but you should be careful. For example, don't make it difficult to read the GRUB instructions by placing complex graphics behind the text.

Here are the rather strict requirements for the image:
  • It must be sized at 640x480.
  • It must be a .xpm format image file (gzip compression is optional).
  • It must contain no more than 14 colors.Most people will cringe at the 14-color limit, but it is rather amazing what you can do with just 14 colors. Cartoon images are quite suitable for this narrow range of colors, and the narrow range of colors to represent the official Linux penguin (Tux) works fine.Find or create any image you want to try as a background for GRUB.

If you create an image yourself, it's best to create a 640x480 image and use as few colors as possible so that you don't lose the fidelity of the image when you later reduce it to 14 colors. Don't worry about using your graphics editor to limit yourself to 14 colors, however. It is possible to use the Gimp to reduce your image to use 14 colors, which can be a good way of fine-tuning the results you want.
Here is what you need:
A graphics editor, such as the Gimp, if you want to create or modify an image.
You must install ImageMagick if it is not already installed. Nearly all Linux distributions provide this on the install CD, and you can use your preferred package manager to install it.Suppose you have found or created the image myimage.png.
If you have ImageMagick installed, all you need to do to prepare the image is log in as root and issue these commands:

# convert myimage.png -colors 14 -resize 640x480 myimage.xpm

The convert command recognizes the extension png and knows what format it must convert the image from. It also recognizes the extension xpm and knows what format to convert the image to. The -colors 14 switch reduces the number of colors in the image to 14. If the image isn't already sized at 640x480, the switch -resize 640x480 will do that for you.

This is sample myimage.xpm

No comments: