Jump to content

Photo

BAMU File Format


5 replies to this topic

#1 Sam.

Sam.
  • Modders
  • 134 posts
  • Gender:Male
  • Location:USA

Posted 06 August 2018 - 07:10 AM

BAMWorkshopII supports an unpaletted BAM format (BAMU) and has the following to say about it:

---------------------------
0.3 Alpha Changelog
---------------------------
IMPORTANT NOTE
There is a new file format availble now: the Unpaletted BAM (or BAMU). BAMUs do NOT work with any infinity engine game, however they serve two purposes:

Firstly, they allow the user to create images without first having to decide on the palette colours and serve as a good way to save "work in progress"; the user can convert them to a paletted BAM later and get (hopefully) an optimised palette.

Secondly BAMUs will hopefully be included in the "Beyond Infinity" project, a TeamBG project to create a new engine capable of powering games designed for the Infinity Engine but with greater flexibility.

CHANGE LOG:
o REDID Copy/paste: unpaletted data may now be pasted in (i.e. from external applications)
o ADDED Mouse Wheel scroll: used to zoom image
o ADDED Unpaletted BAM format
o ADDED Paletted<-->Unpaletted conversions
o ADDED Transparent View

New TODO Items:
o Frame Optimisation (i.e. RLE on/off)
o Multi select in frames mngr
o Free Rotations

KNOWN ISSUES:
o BAMU --> BAM palette optimisation is flawed. I'm working on it.
---------------------------
OK   
---------------------------

 

"Beyond Infinity" sounds suspiciously like GemRB.  Was this format ever implemented anywhere, or does any further documentation about it exist?  Looking at a BAMU, the Header looks like:

Offset     Size (data type)     Description
0x0000     4 (char array)     Signature ('BAMU')
0x0004     4 (char array)     Version ('V1  ')
0x0008     2 (word)     Count of frame entries
0x000a     1 (unsigned byte)     Count of cycles
0x000b     1 (unsigned byte)     The compressed colour index for RLE encoded bams (ie. this is the colour that is compressed)
0x000c     4 (dword?)    Unknown field.  One observed value is 0xFF0000FF
0x0010     4 (dword)     Offset (from start of file) to palette
0x0014     4 (dword)     Offset (from start of file) to frame entries (which are immediately followed by cycle entries)
0x0018    4 (dword)     Offset (from start of file) to frame lookup table

Note I’m unsure what the 4 bytes at 0x000c are for.  Any ideas?

 

OffsetToPalette is usually/always 0, and no palette appears to be stored in the file.

 

Otherwise, Frame Entries, Cycle Entries, and Frame Lookup Table sections are the same as in BAM V1, except that frames do not have RLE.  Frame data is stored as 24bpp in the RGB order, and has no scanline padding.


"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

-- to Portalbendarwinden

--------------------

Posted Image
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#2 lynx

lynx
  • Modders
  • 3139 posts
  • Gender:Male
  • Location:Ljubljana, Slovenija

Posted 12 August 2018 - 02:00 AM

Sounds like something long abandoned and unfinished. No mention anywhere in iesdp or gemrb.


GemRB - IE anywhere.
Mages needed! Looking for Planescape: Torment testers
Play android version IS NOT SUPPORTED ANYMORE: reported bugs will be ignored! Still looking for builders ...


#3 Sam.

Sam.
  • Modders
  • 134 posts
  • Gender:Male
  • Location:USA

Posted 12 August 2018 - 06:51 AM

Thanks for looking.
"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

-- to Portalbendarwinden

--------------------

Posted Image
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#4 Miloch

Miloch

    Barbarian

  • Modders
  • 4805 posts
  • Gender:Male
  • Location:At Large

Posted 19 August 2018 - 08:52 PM

Very interesting. Eh, does it work at all? I mean the unpaletted BAM thing, forcing it to a palette? That's sort of our pipe dream, and I thought you achieved it elsewhere, or did you?


Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett


#5 Sam.

Sam.
  • Modders
  • 134 posts
  • Gender:Male
  • Location:USA

Posted 23 September 2018 - 02:14 PM

Very interesting. Eh, does it work at all? I mean the unpaletted BAM thing, forcing it to a palette? That's sort of our pipe dream, and I thought you achieved it elsewhere, or did you?

The command-line tool I'm writing uses a modified median cut algorithm I wrote and seems to produce results comparable to ImageMagick without dithering.  The quantization algorithm supports the alpha channel, but I haven't really tested how good the results are.  I built in the ability to weight the different channels differently, so some tweaking of the default settings may or may not be in order.  My tool can read BAM, BAMC, BAMU, and BAMD files and save them as BAM or BAMC files, optionally with quite extensive compression.  It can also save files as BAMDs or animated GIFs, and can export and import palettes in a variety of formats including PAL, ACT, BMP, visual BMP, and raw.  I natively support GIF and some BMP variants in imports and exports, and use GDIplus for the rest which means BMP, DIB, RLE, JPG, JPEG, JPE, JFIF, GIF, TIF, TIFF, and PNG are also supported, although import isn't as fast.  There are a few more things I'm still working on (like importation of animated GIFs), but I'm working towards an alpha release.  I hear rumors that Beamdog will be releasing another of their in-house BAM tools soonish.  As nice as that sounds, I kind of hope it doesn't render this little pet project of mine obsolete.  I have put quite a bit of time into it over the years.


"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"

-- to Portalbendarwinden

--------------------

Posted Image
___________Old pen and paper modules of the 70s and 80s.___________

CA Forums CA Homepage


#6 Miloch

Miloch

    Barbarian

  • Modders
  • 4805 posts
  • Gender:Male
  • Location:At Large

Posted 27 September 2018 - 07:16 AM

Sounds fantastic. Like, literally the stuff of fantasy heh.


Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it." -Terry Pratchett




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users