PNG is better if there is written text, JPG is better for drawings and images. The best converter is ImageMagick.
# using the ImageMagick c program
system( "convert my.bmp my png");
or using the Perl module, here is a generic conversion routine:
#!/usr/bin/perl
use warnings;
use strict;
use Image::Magick;
my $imgfile = shift; # your BMP file
my $image = Image::Magick->new();
$image->Read($imgfile);
my $blob = $image->ImageToBlob(); # make in memory image
#and to convert
my $output = Image::Magick->new(magick=>'jpg'); # set your output for
+mat
$output->BlobToImage( $blob );
$output->Resize(geometry=>'160x120');
$output->Write( "$0.jpg" );
#or if you want to write to stdout
#binmode STDOUT;
#$output->Write('jpg:-');