Use ImageMagick to change the GRUB splash screen
When you have more than one operating systems installed, a boot loader (should) gives you the choice of the available operating systems you can boot into. GNU GRUB is a popular boot loader used in GNU/Linux systems. A GRUB splash screen is the image that appears behind the GRUB boot menu.
Ok. This article isn’t of much use except to show off in front of your friends who use a plain GRUB screen. But it doesn’t harm to keep your boot screen attractive. If you look beyond the splash screen part, you will come to realize the power of ImageMagick. What’s more, you can do image authoring right from the command line. A big help when you have to resize or convert the format of a large number of pictures.
“ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.”
- First check if you have ImageMagick installed. Get it, if it isn’t installed. I am using a Debian system where the command
apt-get install imagemagick
would install it. In a Fedora system, this would beyum install imagemagick - For this example, I am taking a picture named photo.jpg. We can’t use this image directly as the splash image. A GRUB splash image has the following requirements:
- .xpm.gz type file
- 640×480 resolution
- 14 colors only
- Now comes the power of imagemagick to easily create the image of our need. The command
convert -resize 640×480 -colors 14 photo.jpg photo.xpm
gives us the required .xpm format image. - We now have to compress the .xpm image. The command
gzip photo.xpm
just does that.In fact, it is not necessary for the splash image to be of .xpm.gz format. It will work fine even with a .xpm image. Interestingly, compressed files load quicker into computer’s memory than uncompressed ones. Because of processing powers, today’s computers take lesser time to load a compressed file and uncompress it than to load an uncompressed file by reading a bigger area from the disk drive. Yes, that’s exactly why the compressed Linux kernel is loaded into the memory while booting.
- We now copy the file onto the grub directory.
cp photo.xpm.gz /boot/grub/ - As a precautionary measure, we need to keep a backup of the GRUB configuration file. In Debian based systems, it is the /boot/grub/menu.lst file and in Red Hat based systems (Fedora included), it is the /boot/grub/grub.conf file.
- The final step in the process is to edit our GRUB configuration file. Find the line that contains the word “splashimage” and add edit the address of the image. If the line doesn’t exist, simple add a line similar to the one below, somewhere below the initial commented lines:
splashimage=(hd0,0)/boot/grub/photo.xpm.gz
(hd0,0) corresponds to the Debian partition on my computer. It may be different in yours. - Now save the GRUB configuration file and restart your system.
Tell me if this comes to any use for you.




very good information .I will try it once. Your blogs look quite informative and interesting to me
Saurabh Thakur
February 4, 2008 at 3:21 am
There’s also a nice splashy documentation for Ubuntu @ https://help.ubuntu.com/community/USplash
Good stuff Bibek!
nepbabu
February 7, 2008 at 9:28 pm
Thank you for very interesting post……
Balakumar
May 15, 2008 at 11:05 pm
this is not working with -resize option…
this convert command only convert a jpg to xpm file…
but not convert resize or color option….
tell me some other option or tool
Sorry for my bad english…..
bharat lal
March 10, 2009 at 11:10 am