2002.02.01 01:20 "tiff (libtiff)", by spin soft
2002.02.01 15:00 "Re: tiff (libtiff)", by Tom Lane
Basically, there's a lot of work involved in this. Perhaps someone on the list has a pre-existing project to do image file conversions, but it's not something you can just put together quickly as an example.
For Unixen I'd recommend ImageMagick (http://www.imagemagick.org/); or you could do it with the Gimp (http://www.gimp.org/) if you prefer point&click to command-line tools.
Dunno what's available for Windows or Mac.
regards, tom lane
organizer, Independent JPEG Group