Jump to content


Photo

Simple way to Convert BAM file to an image file


  • Please log in to reply
6 replies to this topic

#1 Bill Bisco

Bill Bisco
  • Member
  • 487 posts

Posted 28 August 2016 - 04:55 AM

Dear all

 

I would like to replace the Gold Colors in this Image with a Shade of Black.  I feel I can easily do this in the GIMP tool, but getting the BAM file into an Image and converting it back is troublesome so far.  I am aware of the BamBatcher Tool,but I can't parse these instructions.  I just want to convert my file that is not installed in the game yet, and don't know how to find the directory.

 

 

 

1. Convert BAMs to BMPs
This option will attempt to extract all frames from the BAMs in the /bambatch/bam folder. It will save these as BMPs to the /bambatch/bmp folder. It will place a number after the filename indicating the BAM frame number.

You can also use this option to extract bitmaps from BAMs directly in the game. This only requires modification of the first COPY statement after the subcomponent (currently around line 10) in setup-bambatch.tp2:
COPY - ~bambatch/bam~ ~bambatch/bam~
To extract all frames from the female elven bard animation, comment out the line above (put // in front of it) and type below it:
COPY_EXISTING_REGEXP GLOB ~^cefb.+\.bam~ ~bambatch/bam~
It is probably not smart to use this for large quantities of BAMs (like all of them in the game). However, it should work for just about any type of BAM (including compressed and run-length encoded frames).

 

I tried BAM Workshop, but that is Pixel editing and much harder for an amateur to get Shading done correctly. 

 

Is there any other simple method to get a BAM into another Image format easily?

 

Thanks,

 

Bill



#2 Argent77

Argent77
  • Administrator
  • 1397 posts

Posted 28 August 2016 - 05:55 AM

For simple modifications like color changes you can use Near Infinity's BAM Converter. It allows you apply a list of filters for all kinds of simple operations without the need to convert the animation into different file formats. You can find out more in the Near Infinity Wiki.

For more advanced frame manipulations you can still use Near Infinity to export the frames into regular graphics files, and later convert the modified frames back with the BAM Converter. For this you can make use the BAM Converter's "BAM Session" feature to reconstruct frame center coordinates or cycle definitions after importing the modified animation frames.


Edited by Argent77, 28 August 2016 - 05:55 AM.


#3 -Miloch-

-Miloch-
  • Guest

Posted 29 August 2016 - 05:33 PM

Regarding BAM Batcher, just extract the mod to any game folder (such as BG2). Put your BAM(s) in the /bambatch/bam folder, execute setup-bambatch.exe and choose the "Convert BAMs to BMPs" option you described. BMPs end up in the /bmp folder. After editing the BMPs, run setup-bambatch.exe again with the reverse option "Convert BMPs to inventory BAMs" (assuming you are making inventory icons; if not, you can rebuild other BAM types short of creature and more complex animations).

 

DLTCEP can do simple BAM color manipulation but it is tough to get it to do exactly what you want. If you know your way around GIMP or another image editing program, that will likely produce better results. I have not tried the latest Near Infinity features, but it sounds like that may also be an option.

 



#4 Bill Bisco

Bill Bisco
  • Member
  • 487 posts

Posted 29 August 2016 - 05:39 PM

Thank you Argent.

 

How do you get the gray save output file enabled?

 

MOlmtZ.png

 

When selecting the Options to modify the BAM colors, it's hard to find a tool that will help easily do what I want it to do.  I just want to change the GOld in the Image above to Black?

 

I looked at your link above.  How do I save these frames as images?



#5 Argent77

Argent77
  • Administrator
  • 1397 posts

Posted 30 August 2016 - 03:47 AM

You can save frames directly in NI's BAM viewer. Select Export... -> all frames as graphics.

The "Replace colors" filter is a good choice if you can modify the palette by external tools.

In my example I have shifted red and yellow color ranges into blue with Photoshop and loaded the exported palette with the above-mentioned filter:

Spoiler

 

The final BAM file: Attached File  ichan19-blue.bam   3.43K   253 downloads

The "Save output file" button is most likely grayed out because you haven't defined any cycles yet.



#6 Bill Bisco

Bill Bisco
  • Member
  • 487 posts

Posted 02 September 2016 - 05:29 PM

Thank you for your reply Argent.  I did not catch the Export button being in an entirely different place.  I thought that such a feature would be in the BAM Convertor Secction in Tools.

 

As a feature request, it would be nice to be able to export Arbitrary BAM Files as BMP or PNG instead of having to have them in the directory.  It would be nice if the BAM Exporter Button Was Right next to the Save BAM Button.  The Tools themselves allow grabbing BAM files outside of the NearInfinity Installation.

 

I really appreciate your help.  I will now struggle through making the Gold in the Armor to Black in GIMP

 

--Bill



#7 Argent77

Argent77
  • Administrator
  • 1397 posts

Posted 03 September 2016 - 01:23 PM

Thank you for your reply Argent.  I did not catch the Export button being in an entirely different place.  I thought that such a feature would be in the BAM Convertor Secction in Tools.

It makes more sense to leave the "Export from game resource to something else" functionality in the resource viewer of the respective types (examples are TIS, MOS or BAM). The BAM Converter (or "Convert image sequence to BAM", as seen in the dialog title in the screenshot of my previous post) provides functionality to import graphics resources into BAM frames instead.

 

As a feature request, it would be nice to be able to export Arbitrary BAM Files as BMP or PNG instead of having to have them in the directory.  It would be nice if the BAM Exporter Button Was Right next to the Save BAM Button.  The Tools themselves allow grabbing BAM files outside of the NearInfinity Installation.

I'll see what I can do.