How to edit index bmp file with transparency

This is a place to post tech details and informative documents about romhacking PSP games.
Post Reply
User avatar
zeromonkey
Hacker, script editor and control freak
Posts: 486
Joined: Thu Mar 05, 2015 3:10 pm
Location: Tennessee

How to edit index bmp file with transparency

Post by zeromonkey » Tue Mar 10, 2015 10:10 pm

This is a combination of the research that myself (zero), flamethrower and SkyWeise put together for editing the indexed bmp file that has transparency layers/effects that is popular in video games. I have seen them used in PSX, PSP and PC games so far but they may be used for other consoles. By no means is any of the information any more important than the other here. I just am copying and pasting the original thread from here to our new home. I am not gonna post all the discussions from the original here. Just the guide. I may tweak the design later on to make it more appealing.

zeromonkey contribution

Important. DO NOT USE PNG FILES. Itpcnv HATES working with them. After this tutorial. Anybody should be able to do it the right way with the tools available.


STEP 1 - GETTING READY

First things first. You have to convert the image file. Basically all there is to this is a simple drag and drop (if you are doing a single file at a time) or you can create a batch script to do the whole folder

How to create a batch tool
@echo off
itpcnv "imagename".itp

repeat line 2 (itpcnv "imagename".itp) for each file.

Now if you are comfortable using a cmd prompt. Here is a little script that will create a text file with all the files in the directory (that I personally use... A LOT). There is a bunch of files in Falcom games. Just make sure you change the cmd prompt directory to where the files are and then copy/paste this little bugger into it and press enter. Boom! You have a list of all the files in the directory in a file called filelist. Now the name filelist can be changed to anything you want when putting the command in. Also, before you create a batch tool using this method, make sure you open the filelist.txt (or whatever you called it) and take the name "filelist.txt" out. This will make itpcnv kick back an error since it is not an itp file. I also suggest learning how to use the column stuff in Notepad++ for making quick and easy batch tools. I won't be covering how to do that.

The cmd prompt code for making a list of files
dir /a-h /b > C:filelist.txt

STEP 2 - GETTING SOME TECHNICAL SHIT OUT OF THE WAY

We have all been there with wanting to use something like MS Paint or Photoshop to edit these files. I mean colga is a good program for just editing images. It reads alpha stuff properly and saves it properly also. BUT....... It absolutely sucks to try and create dialog heavy images when there is no text tool in the program. Henceforth why we wanna use something different (better).

The problems that arise from using something other than colga are due to how the file is saved and hex codes. I have posted 4 images with some information on them below.

Image 1 - This is the file h_000_01.bmp in Photoshop with the color picker window showing the HEX for the transparency layer (color hex = 03 03 02). This will be EXTREMELY IMPORTANT later on. So remember it. Write it down.

Image 2 - This is a description of the header for a bmp broken down to what is where by HEX address. I would have typed that in here but I lost all my formatting when I did. So nevermind.

Image 3 - This is what h_000_01.bmp looks like in my hex editor. This is an untouched version. Also, a very important bit of information. Will explain later.

Image 4 - This is what h_000_01.bmp looks like in my hex editor after I opened it in photoshop and just saved it. I absolutely did not modify a single pixel.

Look over these images. See if you can notice the difference between image 3 and 4 (other than some lines and color boxes). There is where you run into trouble when using image editors. After you do that, head to below the images to finish the tutorial.

Image

Image

Image

Image

STEP 3 - Why doesn't my stuff show up?
Did you figure out what was happening in those big hex images? Notice those missing bytes?

In the original you see inside that box for the color table it goes like this COLOR HEX + FF or COLOR HEX + 00 (example 00 00 00 FF (black) and 03 03 02 00 (almost black - transparent).

FF = The color is visible
00 = The color is invisible (the alpha channel)

In the 3rd image, you see a ton of FFs follow all those colors except for 1. The one in the blue box. It is followed by the 00. This is also the same color from the first image. Did you forget already? I told you to write down 03 03 02. Because sometimes you will have to do a hex search to locate where the alpha color is located.

When you are editing this stuff and you save it. Almost always (unless using colga) will your colors disappear. But you can fix this by going back through and replacing the FF stuff. Just make sure you don't add the FF to the alpha color.

Shit... I lost my train of thought. Will have to come back to this tutorial. I will leave with this parting message.

itpcnv "imagefile".bmp
or
itpcnv -v2 "imagefile".bmp

try these commands. I think one of them compresses and the other doesn't. My brain has been bombarded by my son with a 30 minutes meltdown over postage stamps.


In a nutehell.

Use bmp.
You can use any image editing software.
Use hex editor to fix color table.
import back into itpcnv (you can drag and drop if feeling lazy)

My exact process for editing files
Drag and drop the itp file on to itpcnv (unless I am working on a bunch of files at once, then I create a batch tool).
Open the bmp in Photoshop CS6 (version I have - not important)
Take note of the transparent color by using the Color Select tool
Click on Image in the top tool bar and turn the image into RGB (because it adds some extra features)
Depending on what I am working with, I either create a layer to edit or just edit the image itself. Layers make for good stuff if you screw up.
Do some cleanup of the image.
Save the image as a PSD (Photoshop File - makes for quick fixing)
Convert the image back to INDEX 256 with no transparency.
Save the file as a bmp 8.
Open the file in a hex editor (got 3 different ones I use) and fix the color table.
Load up itpcnv in the cmd prompt and convert it back to an itp file using either itpcnv "filename".bmp or itpconv -v2 "filename"bmp <-This is the part I got from the Land of Ys thread LOL!
Modify the game files and test.

That is it. Simple and to the point. That is how I edit my files (minus the occasional headache from beating my head on the desk trying to figure out the best way to edit something -> what I ended up doing today while working on some Zero files... just not enough room for all the description with the mandatory information... damn it.)


SkyeWelse contribution

Hello Everyone,

I wanted to add on to this guide that Zeromonkey has started to describe a alternative process that Flamethrower and I have discovered to be successful in editing images that use more than one transparency color. I just started working on the Nayuta no Kiseki project with Flamethrower recently and I immediately dove into this starting with graphics that were needed that seemed would be the easiest to edit, such as chapter screens. They are full sized 512 x 256 images that take up the entire screen and do not contain transparency or alpha channel information.

For these images, using the ITPCNV to PNG 256 process worked well for us, however I seemed to be unable to find a valid method of exporting these images correctly using Photoshop CS6, which is what I preferred to use as my main graphic editing software. By this I mean the ITPCNV would not understand the exported PNG format and would simply not convert anything, most likely due to what Zeromonkey described happens when simply saving a file, Photoshop and most likely mainly other programs out there will conveniently rewrite some of the color information.

Instead of exporting a ready-to-convert image using Photoshop, Flamethrower discovered instead that a free software package called Paint.net would work just fine with saving and exporting these out an PNGs with Dithering level set to 0% and Transparency set to default, which I believe was 128. This would result in a PNG 256 file that would easily convert back to ITP and could then be inserted back into the game.

The next set of files (that I have not started on yet) are Help Files or Tutorial files listed in the ISO of Nayuta no Kiseki in the help directory under visual. These files actually have a transparency layer on them, but I believe it is one transparency color (ON or OFF) that is being changed in Photoshop when saving these out, so Zeromonkey's process for this should work just fine if Photoshop is to be used, which will likely be the software I will utilize when editing them.

But what about some of the sprite graphics that have more than one transparent color? It seems there are about 6 images listed in the System folder of the Nayuta no Kiseki ISO that contain graphic sprite sheets. The first of these sprite sheets that I have been attempting to edit with quite a bit of trouble is that of the graphic "m_main.itp". This is an important sheet as it contains several elements that are used throughout the game, things such as Now Loading, Main Menu icons, and underlays of gears and designs that are intended to be animated in the background of various menus.

When I initially started working on m_main.itp, I was working in PNG, and using the same process as above for the Chapter screens, but I noticed that in doing so I was seeing several artifacts and borders being added to the edge of these floating graphics, so PNG was definitely not an option if we wanted to keep all the different transparency color intact.

I then tried Zeromonkey's process above, forgetting all about using PNGs and instead converting everything using ITPCNV to BMP files and opening the original m_main.bmp file in Photoshop, and before anything else taking the color picker tool to look at the RGB / Hex Color values, which is the case of this graphic were 42 39 36 or in hex #2a2724, setting the graphics MODE to RGB, making edits, changing it to Index 256 colors with no transparency and saving it as a new bmp image. Then using a Hex editor I did a search for this color and found 00 24 27 2a 00, with 00 in front and 00 in back of the color.

However, after playing around with changing these to FF either in front or in back (Keeping in mind that I'm not a programmer and this is the first time I've actually used a HEX editor being for the Nayuta no Kiseki project) it did not seem like anything I could alter would really fix the image. In most of my tests when loading this particular file into the game, I would usually get mostly invisible graphics for anything that was supposed to be displayed from this file. Please feel free to test your process on m_main.itp Zeromonkey, because if there is something easy that I'm missing that would allow me to work within the desired program of Photoshop, I'm all ears.

So over the last few days Flamethrower and I have found a new process that seems to have had pretty good results so far:

Alternative Guide for Working With Graphics with Multiple Transparency Colors

ITPCNV TOOLS - This a zip file of various helpful tools that will be needed for this process.

First, I use the ITPCNV program to convert any needed ITP files in a folder to BMP. There is a bat file called "tobmp.bat" that will automatically search for and convert all files in the same directory of where the ITPCNV program is as well as any subfolders. If you have the entire ISO extracted and you put ITPCNV and this batch file, it will change all ITP files to BMP. This is useful and very quick if you just want to look at each of the BMP images to see which ones you need to start editing.

I then make a backup of the file I wish to work with, in this case m_main.bmp and make this backup to the following naming convention:
filename.orig, or in this case m_main.orig.

Next, I open the converted m_main.itp in the free graphics software called GIMP. I'm not wild about using GIMP mainly because I'm so used to Photoshop, but GIMP does have some nice features and it does have a good export option when saving Bitmaps that you can "check" the Do not write color space information option, which is important for the next steps.

I finish editing the file that I would like to test next inside of GIMP and I can save the file as a GIMP document or XCF file if I would like to resume editing at a later time. I then click on Export, choose Bitmap, and then make sure that under Compatibility Options that Do not write color space information is checked. *Note* If it's my second or consecutive time of saving the file that I would like to test next, there is an option to "export to bitmap" which retains the same setting I previous exported as, which saves a little bit of time.

This saves the new edited bmp into a location of your choosing. I choose to place it inside a folder with other scripts. Inside that folder I have that copy of the original exported Bitmap file that has been named to named m_main.orig. Also in this folder I have a Python script that Flamethrower made called znk_bmp_pre-conversion_tool_v2.py as well as another bat file called toitp.bat. I run the Python script either through Command Line or through the IDLE gui interface, though if the script is run in the gui interface, then an extra line of code is needed. In this case, Flamethrower provided a piece of code just before the last line that says: myprogram(sys.argv[1]):

This code is: sys.argv.append('m_main')
*where m_main can be replaced with whichever graphic file name you happen to be working with at the time.

When you run this, it will save the color information from the original image (m_main.orig) back to the Bitmap.

Next run the bat file "toitp.bat" and edit it as necessary to include the filename (or filenames if you are working with more than one image) with ITPCNV.exe in the same folder.

Also part of the process, but specific to Nayuta no Kiseki for the most part

I then take that new ITP file back over to a different folder where any other files that I would need to often insert into the ISO reside. Files like first.dat, data.lst, st_0.itp (Event - Prologue Chapter) and of course the new m_main.itp.

Because any time you change the bitmap file, it may differ in file size, the data.lst will also need to be updated to reference this change in file size. Fortunately Flamethrower has also made a Python script to do just that called "nayuta_data.lst_updater_(itp).py" which will update the data.lst file. I run that, and then take any needed files and put it into the ISO and generate it after re-inserting the filelist that was exported from the original ISO. I can test using PPSSPP pretty quickly and since this is the main menu, I simply load my save game and test.

I did want to mention this though as I found it to be pretty helpful:

So, if you are working with Bitmaps inside of Photoshop (CS6) for example and you want to use that to do most of your edits and then import this into GIMP, you should follow the process you described in your guide for turning the MODE to INDEX 256 and save it out as a 8-bit Bitmap. From there, you can import your file into GIMP and use their crazy layering system controls to copy at paste the section you were working on onto a new layer in GIMP and overlay that ontop of where it need to go on the original unedited bitmap file that you've opened in GIMP. If you've done this step correctly, then most of the colors should be set correctly and you can edit any colors that did not import correctly pixel-by-pixel inside of GIMP if needed and then export that BMP out of GIMP as you normally would, run scripts, insert and test in the game.

So as an example, speaking for the m_main.itp graphic sheet, I may not want to edit the entire bitmap in GIMP (because I hate using it) or in (Photoshop as that will cause problems most likely) so I may just edit a section or a particular graphic, say, an icon. I'll export that icon as a INDEX 256 8-Bit bitmap, import it into GIMP. Match it up on a new floating layer overlaying the spot where you want it to go on an unedited, freshly converted bmp converted using ITPCNV, and edit any color areas you find problematic, and then export as you normally would through GIMP. I just did that for 3 icons since I'm much quicker in Photoshop than I would be in GIMP.

One interesting thing I did discover was that, If I brought in an actual PSD file inside of GIMP and made that same section I'm talking about above as a new layer and overlay, it will not only not work correctly or convert back to ITP using ITPCNV, but it will actually change certain color values of the original image. I started seeing places that were obviously Hex color 000000 for transparency changing to something like 23221 or some shade of dark grey even on the original image! Not just the floating layer that was imported. If I removed that floating layer which was from a PSD file, things went back to normal for the orignal image and the color values went back to being 000000! So the step of saving your work in photoshop as an 8-bit bmp is pretty important.

Part 2, Working with Multiple Transparency Colors

So before I forget to do this, I wanted to go ahead and finish up my notes and offer a tutorial of sorts for the process that Flame and I did for the graphics in Nayuta no Kiseki that had multiple transparency colors.

Preparing ITP graphics that use multiple transparency colors to be converted back to ITP

So this is a process that pretty much follows the same pattern for each graphic you are working on, however the exact colors that you may be using may be different depending on which graphic you are working on. So far this process has been successful with all ITP graphics that utilize one or more transparency colors.

As mentioned in a few earlier posts, the freeware program GIMP offers a unique feature that some of the other programs out there do not, which is to export the image without writing color space information.

It also has another interesting feature as well called “Colormap”. To access the Colormap, you simply need to add the Colormap tab to your Toolbox. This can be done by selecting “Windows” under the main navigation tabs, and then Dockable Dialogs and then selecting “Colormap”.

The most useful thing about this Colormap feature is that it shows ALL 256 colors being used by color index, 0 – 255. And more importantly, you can assign any color index a HTML notation hex value, which is really the most important step in making sure that these transparency colors can be edited correctly.

Okay, so normally when you open an image that has been converted to bitmap by using ITPCNV and this image has multiple transparent colors, the image itself already has shades of “blacks” and “whites” to assign various transparency values to, yet when you use the color picker tool and say select “black” or something that you know should be one of the transparent colors, you would simply get “000000” which usually is the default case of being completely invisible. So what about the other colors/shades/transparencies? How to select them and what exactly are they doing?

That’s where this Python script that Flame put together comes in handy. bmp_color_analyzer.zip

This Color Analyzer tool when run on a particular bitmap image will output some very useful data. Let’s take for example an image from Nayuta called “m_field3.bmp” (originally m_fied3.itp).

Running the script on this file will net the following information:
-----------------------------
Black Colors:
Color: 0, R: 0, G: 0, B: 0, A: 13
Color: 1, R: 0, G: 0, B: 0, A: 25
Color: 2, R: 0, G: 0, B: 0, A: 37
Color: 3, R: 0, G: 0, B: 0, A: 47
Color: 4, R: 0, G: 0, B: 0, A: 67
Color: 5, R: 0, G: 0, B: 0, A: 81
Color: 6, R: 0, G: 0, B: 0, A: 96
Color: 7, R: 0, G: 0, B: 0, A:112
Color: 8, R: 0, G: 0, B: 0, A:126
Color: 9, R: 0, G: 0, B: 0, A:143
Color: 10, R: 0, G: 0, B: 0, A:166
Color: 11, R: 0, G: 0, B: 0, A:191
Color: 12, R: 0, G: 0, B: 0, A:206
Color: 13, R: 0, G: 0, B: 0, A:217
Color: 14, R: 0, G: 0, B: 0, A:238
Color: 15, R: 0, G: 0, B: 0, A:255

Dark Colors:
Color: 24, R: 3, G: 3, B: 11, A:108
Color: 25, R: 3, G: 3, B: 13, A:191
Color: 26, R: 3, G: 3, B: 14, A:159

White Colors:
Color:254, R:255, G:255, B:255, A: 42
Color:255, R:255, G:255, B:255, A:255

Light Colors:
Color:240, R:240, G:240, B:241, A:255

No Unused Colors.
-----------------------------
As you can see these colors are broken down by RGB, and A for “Alpha Transparency”. The higher number “A” is, the more visible that color will appear when used. A value of 0 would be completely invisible while a color of 255 would be completely opaque.

So… by looking at this information, we can make a determination of which Black color is completely solid, (Color 15) and which White color is completely solid (Color 255), and where the other black/white colors fit in.

The next step would be to assign HTML Notation / Hex values to each color you intend to use and/or identify when using the color picker tool.

I usually set mine up like this as an example:
Color 0, I use 000000, Color 1, I use 010101, Color 2, I use 020202, et cetera.

If I want to make the Opaque Black a completely different Hex value to make it stand out for me, I can do that too, but usually I just look at the script output above and remember which Black and which White colors are my Opaque colors. (15 and 255 respectively, although keep in mind that this can change based on the graphic you are working with.) I usually make solid White one that I can identify and make sure it is changed by instead of giving it FFFFFF, I give color index 255 a value of FFFFFe. Just so I can without a doubt no for a fact that if I select a color (say for text) that needs to be Opaque white and it shows up as FFFFFe, I know I’m working with the right color and that it will not have any transparency.

Here are some screenshots to show more what I’m talking about at this step:

Image Image Image
Image Image Image
Image Image Image
Image Image Image
Image Image

*Note, after making any changes to the Colormap, make sure to Save your document. In my experience if you do not save after making a change to the Colormap, you run the risk of the changes to the Colormap not updating correctly.

Here is an example graphic that I was working with that required working with multiple transparencies. On the world Map of Nayuta, we have the graphic for the location named “Star Garden” which needs to more or less fade off into a drop-shadow effect, and the white color used inside the graphic for pure white needs to be drawn with the Hex value color that you chose for Color Index 255, which in my case was FFFFFe.

Image
So how to achieve that shadow effect? Well in Photoshop it’s easy to do that, you simply tell the layer you are working with that you want to use a stroke of 1 pixel (more if you desire it), and try to import JUST the shadow effects only into GIMP on a separate exported graphic after converting it to Index 256 and saving it as a BMP. It’s important to try and only get the shadow effect because you’ll be importing this into GIMP and using it on its own layer as a means of aligning it to the existing graphic you are working with (which should not have a shadow on it) and overlaying the Shadow only layer on top of main graphic. So it should look like something below:

GIMP LAYERS
1. SHADOW ONLY
2. MAIN GRAPHIC (Star Garden, without Shadow)
3. ORIGINAL IMAGE (JAPANESE)

*Note if you are trying to use Photoshop to export only the shadow layers, I find that the easiest method is to simply create the desired shadow effect that you want, and inside the layers window select the Fill percentage of that particular graphic and take it from 100% opacity to 0% opacity for the Fill layer. That should leave the shadow and or any effects you have going on in place while you only eliminate the visibility of the main graphic. That will help you get a Shadow Only Layer.

Next, for this graphic and others like it, I wanted to make things a bit easier on me for editing purposes inside of Gimp, meaning I wanted the black pixels of the shadow closest to the main graphic of Star Garden to more transparent than the outside layer. If we are talking about a shadow border around the whole graphic that is roughly 2 or 3 pixels thick, then that first pixel border would be much more opaque than it would be transparent, so I would pick a careful guess as to what I wanted that to be. And then for the pixels that make up the secondary border that goes around that first shadow border to be a little more transparent and/or fading into colors closest to 000000 or completely transparent, I could control that easier if that too was on its own layer.

So I typically took that imported Shadow later and cut it in half by means of selecting it in GIMP an copying a “Shadow Inner” and a “Shadow Outer” to their own respective layers.

I didn’t have a good example to show for Star Garden on hand, but take a look at how I broke down the one for Rieseweld:

Image

What you see here is part of the Cut-Out-Trick process that I used for selecting the pixels and only copying what I wanted to its own layer. So my original shadow that I brought in from Photoshop was roughly 1 pixel thickness as a black border around the whole graphic originally created using a 1 pixel stroke. I saved this layer as its own layer calling it “Shadow Inner”, but I wanted to grow this selection to make an outer layer too right? Well this can be done easily enough in GIMP by using the “Select Menu” and choosing “by Color” and then once you have your selection, going back to “Select” and then choose Grow selection by 1 px.

For Rieseweld, I got something that looks like the above image, where the black that you see here for inner/outer layers that you see here is really the “grown selection” from my original “Inner Shadow” layer after selecting a new layer and calling it “Outer Shadow” and painting it. So all you would need to do now for this new “Outer Shadow” Layer that you’ve created is to take the eraser tool and erase the shadow that is in this layer that is in the Interior only so that you only end up with the grown selection of the outer black.
So now you’ve ended up with something that looks like this:

GIMP LAYERS
1. INNER SHADOW
2. OUTER SHADOW
3. MAIN GRAPHIC (Star Garden, without Shadow)
4. ORIGINAL IMAGE (JAPANESE)

*Note, you may wish to make both Inner Shadow and Outer Shadow layers visible so you can be sure that there are no missing pixel spaces in between them, and if you need to add any pixels to fill in any missing gaps, just choose to add those new pixels to the Outer Shadow layer since that will be the one that ends up having more transparent pixels anyway and if you have added pixels to the Inner Shadow which you plan to make less transparent and more opaque, then when you test the graphic in the game, you’ll likely discover that something looks a bit off like a jagged tooth of black that doesn’t look smooth sticking out somewhere like a bad case of anti-aliasing.

So let’s take a look at what we have here for Star Garden:

We have the main graphic without shadow:
Image

We have the first Shadow Layer (Inner Shadow)
Image

We have the second Shadow Layer (Outer Shadow)
Image

How the main graphic for Star Garden looks with only the first Shadow Layer (Inner Shadow):
Image

How the main graphic for Star Garden looks with both Shadow Layers (Inner Shadow and Outer Shadow):
Image

So next comes the final steps, which are actually painting the Color Map colors on these two shadow layers and making an educated guess as to which colormap colors that have been assigned Hex codes that you feel would look best before testing.

So for Inner Shadow, that’s pretty easy, you just choose one color that is not too opaque yet not too transparent either and make that entire layer’s color be that colormap choice. Looking back up at our Bitmap Analyzer we would probably want to choose a color that had close to 25% of the total 255 color value for Alpha. 256 divided by 4 gives you 64. So if you look at Colormap index color 4, you’ll see that its Alpha value is 67, which would be the ideal color to start with and decrease or increase Alpha transparency as needed by picking the next color up or down as you need. If you were going with index color 4 and using my model of naming the Hex Values in order would likely be Hex color “040404”, so I would select that color and paint the entirety of “Inner Shadow” in that specific color. And a good rule of thumb is to double-check your work. After painting it, go back with the color picker tool to make sure that it shows that you have used the correct color you wanted.

Now for your Outer Shadow, that gets a little more tricky, but not too bad, but you just want to make sure that the majority of it is fairly close to the lowest Alpha value that you can get to without being completely invisible, so in this case index color 2, or 1, depending on how close it is to the Inner Shadow. BUT for areas that have corners or sharp diagonal curvatures, I like to go ahead and use Index color 0 or 1, whichever ends up being less than the color you are primarily working with for the later because it will help make a smoother transition for these and not make these curves seem jagged or appear to have some bad anti-aliasing going on.

Here’s a screenshot to kind of show what I’m talking about a bit more.

Of course, now that I realize it at this tutorial it would have made more sense to show this for the “Outer Shadow” layer, but I guess at the time that I created it, I was working on the “Inner Shadow” layer. It shouldn’t matter though as the main point I’m trying to make above should become clear after seeing this:

Image

In this image, (and pretending that it isn’t the Inner Shadow Layer closest to the main graphic…), the reds are more opaque and the blues are more transparent. So in this case if we are talking about the Outershadow layer and we were using Index colors 1 and 0, the reds would all be 1’s (010101) and the blue’s would all be 0’s (000000). That will net an ideally softer shadow effect around your graphic if the original graphic were using a black fading shadow like these original Japanese graphics were.

When you are done, all that is needed next is to test. You follows the steps mentioned above exporting it out in GIMP with “Do not write color space information” checked, and run the Bitmap Pre-Conversion Tool Python program to match up the colors you are using with that in the original exported bmp named “bitmapname.orig” and inserting that into the game to be tested.

It does take a lot of trial and error if you want the graphics to look the way you want them to, so be prepared for that, however it does become easier the more you familiarize yourself with the process and the better you get with using the GIMP software, which for me was not very intuitive to use.

Best of luck and hope this helps!

-Thomas

flamethrower
Programmer
Posts: 995
Joined: Mon Mar 09, 2015 3:03 pm

Re: How to edit index bmp file with transparency

Post by flamethrower » Sat Dec 09, 2017 9:50 pm

Our troubles two years ago were caused by a bug in ITPcnv (pokanchan's version). If you are converting PNG256 to ITP with ITPCNV, it will put down alpha values for fully opaque pixels as zero. And that is a bug - it should be putting 255 for alpha values for fully opaque pixels.

We have advanced a lot from two years ago and I have written my own ITPcnv program that will convert png256 to the PSP version of the ITP format. This was a quick process because I previously wrote a FALCOM3 compressor which this tool needs to work.

What you have to do is:
Make a project file in your favorite image editing program (any of them should work).
Export to PNG with transparency, 32-bit.
Convert to PNG256 (8-bit PNG with indexed color). There are various tools to do this, I used pngquant https://pngquant.org/
Convert to ITP using my tool.

About my tool:
Needs Python 3. Needs PyPNG (python package for working with PNG files) to work. https://pythonhosted.org/pypng/
Attachments
ITPcnv.7z
(2.89 KiB) Downloaded 84 times

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests