Home > Programming & scripting, Python > BMPDecode version 1.1 released

BMPDecode version 1.1 released

February 21st, 2007

Just implemented the ability to export BMP’s as RAW RGB data in BMPDecode since I needed a tool to do this.
I tried it out by exporting some textures as raw RGB and loading them into opengl as textures and it worked fine :)

So if you need a quick converter from BMP -> RAW RGB/RGBA this is your fix!

Changelog:

Added these methods:

     |  exportRAW_RGB(self, outfilename)
     |      exportRAW_RGB(filename) -> no return value
     |      Exports the data contained in the decoder to a RAW
     |      RGB data file with the filename passed as an argument
     |
     |  exportRAW_RGBA(self, outfilename, alphavalue=255)
     |      exportRAW_RGB(filename, alphavalue=255) -> no return value
     |      Exports the data contained in the decoder to a RAW
     |      RGBA data file with the filename passed as an argument

Download here!

Example of use:

import bmpdecode
decoder = bmpdecode.BMPDecoder("mybmpfile.bmp")
decoder.exportRAW_RGB("myraw.raw")

Optionally call

decoder.print_fileinfoheader()

to get the height/width of the image since t is not saved in the RAW file.

buffi Programming & scripting, Python

  1. Vanessa
    October 8th, 2007 at 23:24 | #1

    Any chance I could get a copy of your script? The link no longer works.

    Thank you!

  2. October 11th, 2007 at 16:28 | #2

    Sorry bout that.
    It is now online at
    http://www.buffis.com/pub/stuff/bmpdecode1_1.tar.gz

  3. April 9th, 2008 at 22:23 | #3

    link is broken - still.

  1. No trackbacks yet.