Thursday, December 27, 2007

GRUB Splash Image HowTo

http://forums.fedoraforum.org/showthread.php?t=1243
http://ruslug.rutgers.edu/~mcgrof/grub-images/
http://gentoo-wiki.com/HOWTO_Splash_image_in_GRUB

Instructions

Requirements for GRUB splashimages:

1. xpm.gz file type
2. 640x480
3. 14 colors only

If you already have your image:

1. Gzip your xpm file and put it into your /boot/grub directory (as root)
Code:
# gzip myfile.xpm

2. Edit your grub.conf file
Code:
# nano /boot/grub/grub.conf

and add this line:
splashimage=(hd0,0)/GRUB/myfile.xpm.gz
NOTE Change the partition and directory according to your system's setup.
3. reboot

How to convert an image to only 14 colors
To get the GIMP to use only a 14 color palette, right click on your file and press ALT+I and put 14 where it says "Generate Optimal Palette:" on the top of the menu. If ALT+I doesn't get you there then right click on the image and go to:

Image-->Mode-->Indexed

Specify you want 14 colors and then if you want (*recommended*) select NO DITHERING. This will tell the gimp not to try to guess colors in between areas.

It does not have to be filename.xpm.gz only, but, compressed files load quicker that uncompressed files.

You can also change the foreground and background color of the menu, like this:
Just put something like the following in your menu.lst file:
foreground = ffffff (for text color)
background = 000000 (for background color)

Colors:
ffffff = white
000000 = black
333333 = cyan dark
666666 = cyan light

View images of currently available splashimages

Download working publically available GRUB splash images

------------------------------------------
The complete GRUB Splash Image Howto is here

Good Luck !!!
___________________________
Greetings
gonzalo


===================

Introduction

The splash image is the image shown in the background when GRUB is displaying the list of operating systems you can boot. All you need to customize it is the GIMP or Imagemagick. You will need to make sure your GRUB supports the splashimage command. I took image from gentoo.org and cut a little for the GRUB background.

Creating image (GIMP)

1. Start the GIMP.
2. Click on File » New or type Ctrl+n
3. In the new image dialog, change Width to 640 pixels and Height to 480 pixels (the image should be of size 640x480 pixels). Now click OK.
4. Create the image which you would like to be the splash image. It's quite fun to experiment with the various tools of the GIMP!
5. After you have finished creating the image, hit Alt+i or right click on the image and click on Image » Mode » Indexed.
6. In the Indexed Color Conversion dialog that appears, click on the radio button Generate optimal Palette and in # of colors enter 14. Click OK (the image should be of only 14 colors).
7. Now right-click on the image and click on File » Save As.... Save the file as ImageName.xpm in a directory of your choice. If you can't create ImageName.xpm you can save it as ImageName.png and then convert it with convert ImageName.png ImageName.xpm (convert is a part of imagemagick).
8. Open a terminal, change directory to where the ImageName.xpm was saved, then compress it using GNU-zip: gzip ImageName.xpm

But be careful if you create you work with GIMP under Windows. It will use the standard Windows newline CR+LF. Nethertheless it seems as if GRUB can only cope with plain LF newlines. You have to convert the lineformat manually.

Creating image (Imagemagick)

You can also pick an image (any type supported by ImageMagick) and execute:

convert picture.jpg -resize 640x480! -colors 14 -depth 8 ImageName.xpm.gz

Installing the Image

Make sure you are root, then run the following in the terminal:

# mount /boot
# mv ImageName.xpm.gz /boot/grub/


In the /boot/grub/grub.conf you have to point splashimage to newly created image i.e.:
File: /boot/grub/grub.conf

# Splash Image
splashimage=(hd0,0)/grub/ImageName.xpm.gz

If your boot splash did not change,then try the following:

# cp ImageName.xpm.gz /boot/grub/splash.xpm.gz

That's it! When you reboot, you will find your image in the background, with the menu of operating systems etc. in the foreground.
Changing text colors

If you do not like the look of the default text settings (white text with black shadow and highlighting) or it turns out to be hard to read with your splashimage even though the color command wont work, there is a way to modify these. Use the command foreground to edit the text and border color background will do for the shadows and highlighted background of the selected item.
File: /boot/grub/grub.conf

# Set text color to RRGGBB
foreground RRGGBB

# Set shadows and selected highlight to RRGGBB
background RRGGBB

RRGGBB must be a HEX-Colorcode, i.e. numbers 0-9 and letters A-F, each group of two representing a color. You can either try it out (R means red, G means green, B means blue, so the range from 00 to FF allows you to address a range of 0 to 255 for each color that will then be combined with those of the others to make up the color you chose) or (more conveniently ;-) copy the 6-digit code that e.g. the KDE or GIMP color choosers provide.
Credits

* Some splash images
* Some more splash images
* Even more splash images
* ImageMagick Tricks book