DroidWarez Now! Logo [Hosted as part of the DroidWarez Empire at http://www.DroidWarez.com]

sabwbmp

GPL'd command line BMP to WAP happy WBMP Converter for Windows and UNIX

by Scott A. Belmonte

The sabwbmp homepage is at http://www.DroidWarez.com/sabwbmp/

|----------------------------------------------------------|
|                sabwbmp BMP to WBMP Converter             |
|                 (c) 2000 Scott A. Belmonte,              |
|             http://www.DroidWarez.com/sabwbmp/           |
|----------------------------------------------------------|

SABWBMP Now! Logo
[Introduction | Download/WAP Links | Technical/Usage] | [Example]
[SABWBMP is Crap! The Image does not Display!! (Problem Solving)
[Get Win sabwbmp Now! (48kB) | Get UNIX sabwbmp Now! (23kB)]

What's New

  • 10th January 2001: New version of Sabwbmp that fixes up problems with "padding" that could cause images not to display properly
  • 8th January 2001: Bad links and things by Lachlandroid - fixed by Lachlandroid.
  • 25th May 2000: sabwbmp released to the world

Introduction to SABWBMP

Welcome to the sabwbmp software page. Sabwbmp is a command line program (that knows about BIG_ENDIAN and LITTLE_ENDIAN computer systems) designed to convert BMP files to WBMP image files suitable for display on compatible WAP enabled mobile phones and other WAP (Wireless Application Protocol) complient browsers.

Sabwbmp "c" source code and MS-Windows 32 bit executable is distributed under the GNU Public Licence (GPL). This is free software so please share, modify, distribute and enjoy.

Why Bother Using sabwbmp?

  • In theory, unlike many other wbmp converters, sabwbmp is a tight, convenient, small BMP to WBMP converter that seems to work OK on a variety of computers. This is because sabwbmp knows about BIG_ENDIAN and LITTLE_ENDIAN computers whereas many WBMP converters are PC centric making them quite unreliable if you are using a variety of different computer types.

  • sabwbmp performs some simple but very powerful filtering of colours such as a varying blue background to try and get an easilier to read 2 colour WBMP file.

  • sabwbmp tries to give you the options to make a decent WBMP file for WAP applications given the severe limitations imposed by the present WAP enabled phones (Black and white images with small displays).

  • sabwbmp works via the command line, thus is very suitable for "just in time" image creation required by dynamic WAP enabled pages and web-servers.

Type sabwbmp on the command line with no options to get a simple help and options listing.

256 Colour BMP Before

256 Colour BMP Before being Converted with sabwbmp

2 Colour BMP Before

2 Colour dithered BMP Before being Converted with sabwbmp

SABWBMP Converted

After being Converted with sabwbmp

SABWBMP Converted

After being Converted with sabwbmp

Version and Download Information


Technical/Usage Information

sabwbmp V1.0 usage:

Usage:

  sabwbmp [Options] input_file output_file
   Options:
    -d       Debug: Outputs info about BMP and WBMP files
    -r       Filter out red.
    -g       Filter out green.
    -b       Filter out blue.
    -t #     # between 0-100: if colour is RGB then
             if R+G+B greater than # percent then pixel
             is set to white.

Example

In JPG Format: [Original JPG File] | [GIF version of Shrunk down 256 Colour BMP File] | [GIF version of 2 Colour WBMP File Converted with sabwbmp]

Imagine you have generated a 640 x 480 pixel JPG file on the fly and need to convert this on the fly to a shrunk down WAP happy WBMP image. Following is one example on how to do this

First use the Independent JPEG Group's free JPEG Software to resize and convert the image to a 256 colour BMP file. (ftp://ftp.uu.net/graphics/jpeg/)

/usr/local/bin/djpeg -scale 88/640 -bmp -colors 256 status.jpg > status.bmp Then use sabwbmp to convert into a WBMP file (you may have to much around with the filter settings to get the desired result. In this example, we wish to filter out the blue background):

sabwbmp -b -t 20 status.bmp status.wbmp


Note: If you want to have the Independent JPEG Group's free JPEG Software (or your favourite software) to do all the colour conversion work, use the following style of command. This will create a dithered 2 colour BMP file that can be converted without any options into a WBMP file using sabwbmp.

/usr/local/bin/djpeg -scale 88/640 -bmp -colors 2 -grayscale status.jpg > status.bmp

Then use sabwbmp

sabwbmp status.bmp status.wbmp

SABWBMP is Crap! The Image does not Display!!

WAP WBMP Image is Not Displaying!

WBMP file not displaying properly in WAP device

This is most likely a problem with the emulator or WAP enabled device not reading the width and the height of the image correctly. Also, note that the pre 10th January 2001 version of Sabwbmp had a bug with "padding" that could also cause images not to display properly. This has been fixed in the latest version of Sabwbmp.

One suggestion is to try keeping your image below 128 pixels might fix this problem up. For WBMP images creater than 127 pixels in width or height, the WAP emulator or Browser would have to read the multibyte encoding of the height and width properly to display the image correctly. Keeping the size below 128 pixels across or down ensures the height and width is always encoded in one byte keeping it compatible with these poorly written WAP enabled programs.

WAP WBMP image is now displaying

WBMP file Now Displaying in a happy fashion


Also, make sure that the BMP file is not more than 256 colours. Some graphics program claim they have saved at reduced colours, but this may not be so, or they may not be doing a proper job creating the BMP file.

Problem finding and using the SABWBMP Debug mode

It might also be possible that SABWBMP is unhappy? How do you tell? Try using the -d debug option to check out what sabwbmp is doing. As part of the "-d" debug option, SABWBMP gives out the header information and "*"s indicating where the white pixels are. E.g.,:

sabwbmp -d -b -t 20 status.bmp status.wbmp > out.txt

bfType = 19778
bfSize = 11878
bfReserved1 = 0
bfReserved2 = 0
bfOffBits = 1078
biSize = 40
biWidth = 120
biHeight = 90
biPlanes = 1
biBitCount = 8
biCompression = 0
biSizeImage = 10800
biXPelsPerMeter = 0
biYPelsPerMeter = 0
biClrUsed = 256
biClrImportant = 256
bits_per_wbmp_row = 120
Padded bits_per_wbmp_row = 120
bytes_per_wbmp_row = 15
bits_per_row = 960
Padded bits_per_row = 960
bytes_per_row = 120

...***...****....***......***...........................................................................................
..*****..************....*****..**........**............................................................................
..**.**..**.******.**....**.**.****.****.****.*..*..***.................................................................
..*****..*****..*****....*****.****.*******************..........**.*..**.**..**.*......*****..****.......***********...
...*.***.*****....***.....*.***.**..*****.**.******.****.........******.*****.****.......****..*********...********.*...
..******.**.*********....******.**.******.**.******.*.**.........**.**..*.**.*****......**..*..******.**..***********...
..*****..**..**.*****....*****..*********.***.**********.........**...****..*....*......*****..******.**..*****.*****...
.....................................................................................................**.................
........................................................................................................................
........................................................................................................................
...*..*..*...*...*...*...*...*...*...*...*..*...*...*..*...*...*...*...*...*...*...*...*..*...*..*..*..*...*...*...*....
........................................................................................................................
........................................................................................................................
........................................................................................................................
...................................***.....***...............................................****....***................
....***.............*..............*.**...**.*.........**......*..*.*...*....................****....*.**..*..*.........
...*..**.*******.****.............**.**...**.*..*****.***......*..********.****.**.*.........*..*...**.**..**********...
...*..**.**.*.*******.............**.**...*..*..*.*.*.***......*..****************...........*..*...**.**..*****.***....
...********.*.*******.............**.**...**.*..*.*.***.**.....*******************...........**.*...**.**..*..**.****...
...................................****.*.****..*.*.**...*...................................****.**.***...*..**..**....
....................................*...*..*...................................................*......*.................
........................................................................................................................
........................................................................................................................
........................................................................................................................
........................................................................................................................
........................................................................................................................
.................................**.....................................................................................
................................*.......*........................***..*..*...*..........................................
................................***.**************...............*.*..****.***.*........................................
................................*...*.************...............*.*..**********........................................
................................*****.******.*****.*.............***..*******.*.........................................
............................................***.*.................*.....................................................
........................................................................................................................
........*.*.......*.....................................................................................................
.....****.*.*****.***.***...............................................................................................
......*******.************..............................................................................................
......**.*.*********.*****..............................................................................................
............******..*...*...............................................................................................
.............*..........................................................................................................
....................**.......**..***.***..........................**.......**..***.***..................................
....................***.....*..*.*...*...........................***......*..*.*...*....................................
....................***.....*..*.***.***.........................***......*..*.***.**...................................
....................***.....*..*.*...*...........................*.*......*..*.*...*....................................
....................**.*....****.*...*............................***.....****.*...*....................................
........................................................................................................................
........................................................................................................................
........................................................................................................................
..................*.**.......**..***.***........................*..*.......**..***.***..................................
.................*****.*....*..*.*...*.........................**.**.*....*..*.*...*....................................
.................*****......*..*.***.***........................*.**......*..*.***.**...................................
.................*****......*..*.*...*..........................****......*..*.*...*....................................
....................**......****.*...*...............................*....****.*...*....................................
........................................................................................................................
........................................................................................................................
........................................................................................................................
........................................................................................................................
........................................................................................................................
......***....................**......*.............**....***.........*......*...*......***.....*......**................
......*.***.*****.....*........*......*.....**.....*.....**....*....*......*..*.**.*....*.....*.*....*..................
......****.***.**.............*......**....*.*......*....*.*...*....***...******.**.....*.....***....****...............
......*..********............*........*....***.............*.*.*....*.*......***.**....*......*.*......*................
.............................**......*.......*.....**.....*..**.....**.....**..*..*............*......**................
........................................................................................................................
........................................................................................................................
......................*..**.......**.***......**..**....*....*..*.....*..**..*.......**.***...**.....*..*...............
......................*...*....*...*.*.*...**...*...*..**..**..**.*..**.*...**....*..*..*....*.......*..*...............
......................*...*....*...*.***....*..**.......*.*.*.**..*...*.***.*.*.....***.***...**.....****...............
......................*..*.....*.....*.*....*...*...*...*.***.**.**...*.*.***.*........**..*.*..*....****...............
.........................**.......**...........*..**..........*..*.......**..........**.***...**..**....................
........................................................................................................................
........................................................................................................................
........................................................................................................................
........................................................................................................................
........................................................................................................................
........................................................................................................................
...**.**.......*...*.........*****.......*...*..........................................................................
...**.**.**.******.****.**...**..***.*.***.*******.*.****...............................................................
...*****.****.*******.*****...********.*.**.***.****.**.*...............................................................
...*.********.**..***.***.*..*..**..**.****.***.*.***.*.*...............................................................
...*.*.*.*******..***...***...**.*..****.********.*.*.*.*.*.............................................................
........................................................................................................................
........................................................................................................................
......*...........****.....***....**..**...**..**....**.........**.***..*.....*..*..........**..**.**..**...............
...**.*.......**..*..*....*.****..*.*****..*******..*.**...**..*.**.*****.....**.**........**.**.***.*****..............
...****.********..****.*********.**.****..**.**..*..***.*****....*..*.*****...***********....***.***.**.**..............
...*.**.***.*.**..*.*.*****.****.**.**.**.**.**..*..*.*****.*...**.**.***.**..********.**...**.*.***.**.**..............
...*..*.********..*..*.****.****..********.******...**********.***.*..***.*.*.********.**..*******.******...............
................................................................*......................*.....*..........................
.......................................................................................*................................
........................................................................................................................
Writing 1350 bytes to wbmp file.


Feel free to send comments or corrections or suggestions about this webpage to droid@droidwarez.com

N.B. In order to filter spam, only e-mails with the word droidwarez in the subject line will get through. E-mails that do not have droidwarez in the subject line will be deleted automatically.


DroidWarez Now! Logo [Back to the DroidWarez Empire mainpage at http://www.DroidWarez.com]

BOLLOCKS NOW! BORROCKS NOW! STANES NOW! PANTS NOW!