Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

BMP2RAW - Convert BMP to RAW files [CMD]


  • Please log in to reply
2 replies to this topic
BoBo
  • Guests
  • Last active:
  • Joined: --

The BMP2RAW Converter gives you the ability to directly import
uncompressed Graphics into your own Programs (demos, games etc.).
Since none of the common programs, are supporting the RAW-Format
i decided to write my own converter.
Currently it only handles uncompressed BMPs (no RLE8).
Since Windows stores the Files without RLE-Compression, I didn't
implement it...

Features: BMP2RAW works with ALL Resolutions (not only 320x200)
---------- That was one of the main reasons why I did this Program!
It supports 8 & 24 Bit Bitmaps (there are no 15/16Bit BMPs!).

8Bit : Packed Pixel Mode stored as *.R08 and *.PAL
24Bit: Direct Color Mode ( 8:8:8 ) stored as *.R24

CommandLine Syntax : BMP2RAW [max 8 Chars] :roll:

[Download]

How is a RAW-File & how does it look like?
---------------------------------------------

   One plus of RAW-Files is that you haven't to read headers, pre-
   calc something from the header or uncompress the stored data. 
   On the other hand RAW-Files can get very big, due the uncompressed
   storing! (640x480x24bpp = 921600 = 900kb !!!)

   The RAW-Format is an uncompressed Format, that means every Byte
   has its >direct< meaning:

    For example picture RAW-Files:
    ------------------------------

                    FilePos:     0   1   2   3  ...
                                 |   |   |   |
                    8bpp RAW -> $0A $FF $10 $01 ...
                                 |   |
                                 |   |--> Next pixel on the Screen
                                 |
                                 |-------> First pixel (0,0) on the Screen
                                           with palette value $0A!
   
                   24bpp RAW -> $0A $FF $10 $01 ...
                                 |   |   |   |-> B Value of Pixel 1
                                 |   |   |-----> R Value of Pixel 0
                                 |   |---------> G Value of Pixel 0
                                 |-------------> B Value of Pixel 0

 The 24bpp RGB Model (8:8:8 = B:G:R) - For direct use within the Memory/LFB !
 ----------------------------------------------------------------------------

       The RAW-Files are linear, that means they start @ Pixel 0 counting
       up to the last Pixel (xres:= 320, yres:= 200 => Last Pixel:= 63999)

NOTE:  If a 8Bit BMP is converted into RAW-Format, a Palette File of the
-----  BMP-File is created! The Colors are starting @ 0. BMP-Files
       are storing the amount of Colors a pic uses! -> So if a 8Bit pic
       only uses 10 Colors, the Rest of the saved RGB-Values is 0!

------------------------------------------------------------------------------
        The RGB-Values are stored in the Palette-File like this sheme:
------------------------------------------------------------------------------

FilePos:   0   1   2   3   4   5  ... 767 (=> ? => (256*3)-1)

          $10 $01 $03 $32 $15 $23 ...
           |   |   |   |   |   |   
          R0   G0  B0  R1  G1  B1 
           |   |   |   |---|---|---------> Values of Pixel [1]
           |---|---|---------------------> Values of Pixel [0]

The RGB Values are reaching from 0 up to 63 ($3F) -> for direct Palette
programming use.

4. What shall I do with a RAW-File:
-----------------------------------

    8Bit RAWs: You can directly set the Palette, then copy a 320x200 RAW
               directly into the VGAMemory! 

   24Bit RAWs: The RAW is in Direct Color Format (8:8:8) -> Feel free to
               set a TrueColor VESA-Mode and then copy the File into the LFB!
               Or convert it into 16bpp and set a HiColor-Mode...
Taken from its README. :). And of course, there's a good chance that this is outdated (---> 8.3 names). So don't hesitate to ignore it :wink:

Kluter
  • Guests
  • Last active:
  • Joined: --
I have a bitmap, but I can't convert by your sytax

serjG
  • Guests
  • Last active:
  • Joined: --
With Ivan Image Converter I can convert >140 image formats to RAW, also in batch mode. find it here: http://www.ivanview....-converter.html [moderator's note: free trial; $69.95 for full version]