9. WML Images

9.1. Wireless Bitmap (WBMP)

WML cards can contain images. In the early days, WAP-enabled wireless devices only supported the Wireless Bitmap (WBMP) image format. WBMP images can only contain two colors: black and white. Also, WBMP is not a compressible format, since the processor of wireless devices in the old days did not have enough computation power and decompression would result in a long delay. The file extension and the MIME type of WBMP are ".wbmp" and "image/vnd.wap.wbmp" respectively.

To draw WBMP images, a WBMP image editor is needed. The Nokia Mobile Internet Toolkit comes with a WBMP image editor that you can use. Besides drawing WBMP images, you can use it to convert other image formats to WBMP. Just open a GIF or JPG image file with the editor and it will be converted automatically. Free tools such as ImageMagick can also do such kind of thing. However, remember that WBMP images can only contain black and white colors, which means there will have detail loss during the conversion of a colorful image to the WBMP format.

A colorful picture before conversion to WBMP.

The picture after conversion to WBMP.

9.2. Can a WML Browser Display Color Images?

A WML browser can display color images if the image format used is supported by the wireless device. Currently, most mobile phone models on the market have color screens and support color images. Commonly supported image formats are GIF 87a, GIF 89a (animated GIF), JPG and PNG. Note that the image formats supported are device-specific. Some wireless devices can only support a subset of the above image formats.

One simple way to find out whether a particular image format can be displayed on a WML browser is to check the accept HTTP header, like what we have done in the "Choosing MIME Types Dynamically" section of our XHTML MP tutorial. For example, if "image/gif", "image/jpg" and "image/png" are found in the accept HTTP header, it means the WML browser can display the GIF, JPG and PNG image formats.

Previous Page Page 12 of 50 Next Page

Feedback Form (ExpandCollapse)

What do you think about this web page?

(Optional) Please provide us more details. For example, suppose you select option 2 above, can you tell us specifically what information is missing? You can also suggest anything that can help us improve this web page.

(Optional) Your name:

(Optional) Your email address:

Please enter again to confirm:

Due to the amount of messages we received, we may not be able to reply to all messages.

A button for going back to the top of this page