The Haiku/BeOS Tip Server
Tips and tricks for Haiku/BeOS users

Creating GIF images

Contributed by: Scot Hacker
This tip is valid for: Both BeOS and Haiku

As of R4.0, BeOS does not include a a GIF Translator (NetPositive has its own GIF-rendering engine), meaning you can’t create GIF images with BeOS “out of the box.” Until Be resolves its issues with the Unisys patent that governs the GIF compression algorithm, there are several ways to create GIFS on BeOS:

  • Daniel Switkin’s GIF Translator will give GIF-creation capabilities to all of your graphics applications. Switkin’s Anime GIF animator also has native GIF-creation support.
  • BeatWare’s e-Picture will let you create GIFs will all kinds of optimizations, transparency, animation, etc.
  • Sander Stoks’ Becasso will let you create GIFs, but without any compression (Becasso uses the GIF-creation code from netpbm, below).
  • Chris Herborth’s port of the netpbm toolkit will let you translate between just about any two image file formats in the world.

netpbm, unfortunately, makes you do everything in two or more steps, turning your image into a ppm file, and then that ppm file into the desired format.

After getting netpbm installed and working, create some scripts for yourself that will reduce this work to a single command. For example, the script below will convert a file from tga to gif with one command. If you have a file called ScreenShot.tga in the current directory, just type: makegif ScreenShot.

Save the following text as a file called makegif in your /boot/home/config/bin directory, then hack variants of it to accomplish any translations you like.


tgatoppm $file.tga > $file.ppm
ppmtogif $file.ppm > $file.gif

echo Created $file.gif

rm $file.ppm

echo Remove $file.tga?
	read yn
	if [ "$yn" = "y" ]; then
		rm $file.tga

Posted in Miscellaneous

(comments are closed).