How to keep your original image's colors in G-Force sprites

Discussion forum for G-Force users

Moderators: BTT, andy55, b.dwall, juxtiphi

Post Reply
User avatar
duncan
Posts: 11
Joined: Sat Mar 19, 2005 2:56 pm
Location: San Francisco, CA

How to keep your original image's colors in G-Force sprites

Post by duncan »

Hello everyone,

We all love the sprite capabilities of G-Force. But what if you want your image to show up in it's original colors? Flesh tones as flesh tones. Teeth gleaming white and not gleaming... Acid Gap Green or Kauai rainbow colors and whatnot. This came up when my brother's girlfriend wanted her picture to react with G-Force, but recoiled when she saw her face in it's remapped distortion... You know, girls and their vanity... :D

Well! Now you can have your image in G-Force in the colors in which it was originally taken. Having nothing else to do this fine Memorial Day, I figured it out:

You take an image, any image. This is my room:

Image

Then, using Photoshop, convert it to 256-color "Indexed Color" image mode. Then, export the resultant color palette. . .

Image

. . .to a Microsoft .PAL file. Then, using the "Color Table" options from within Photoshop, Switch your image to a 256-color greyscale color palette. This will cause it to appear somewhat strange:

Image

The idea behind twisting the palette this way is that G-Force is going to take this greyscale image, and remap it using our original color palette, which we will supply. Since it maps all 256 colors one-to-one, we will end up with our original image when we run GForce.

Anyhow, be sure to save the image as a highest-quality JPG (we don't want any "loss" or compression), and throw it into the G-Force Sprites/Auto-Foreground folder.

At this point, all that is left is to convert our original image's color palette to a G-Force .MAP file, which is simply an ASCII list of 256 RGB values. Luckily, there is a nice freeware utility which will do just that called Kolorgenerator by Adam Godula (thanks, Adam!) which can be had at www.godula.com.

Now, while I love and appreciate Free software, let's just say that Kolorgenerator is not the most straightforward program in the world... It is great, once you know what you're doing. So, don't get frustrated if it's hard at first... What am I saying, any GForce hacker has the patience of a saint! :wink:

Once you are within Kolorgenerator, you must first import your Microsoft .PAL file (using the floppy disk icon with the red arrow in the "I/O" group). You'll want to expand the colors buffer (the arrows next to the swatches at the top) so you can see your whole palette. Then, you need to go into the Config tab, and at the bottom within the "Color representation format" group, set the drop-down list to "I/O export". This is how you tell the program what ASCII format to export your color palette in. In the text field to the right, type in "dR dG dB*" (without the quotes, but with the asterisk!). Now go back to the "Kolorgenerator" tab. Make sure that "Selected range" is not checked, and then click the button right above it, that looks like a sheet of paper. This will copy your color palette's RGB values to your computer's clipboard.

The last step is only slightly complicated. Basically, what you end up with if you paste the data that Kolorgenerator has created, is one long line of RGB values separated by asterisks. But, AFAIK, G-Force MAP files need carriage returns after each RGB value. So, you need a text editor that will understand carriage returns. You could do it by hand but come on, this is what computers were built for... I use Textpad (www.textpad.com), which is a great program and whose search/replace feature can handle Regular Expressions and therefore carriage returns. If you do it in Textpad, all you need to do is paste in your data, and go to "Replace", click the box that says "Use Regular Expressions", and then replace all "*" with "\n". (\n being the regexp symbol for the carriage return). There may be an extra line at the end of the file that you'll want to delete. Turn on line numbers to make sure you have all 256 values.

Almost done! Now, save this file with a .MAP extension, throw it in G-Force/Colormaps, and write a script that will load the colormap and the sprite:

SetColorMap( "mycolormap", 5 );
StartSprite( "mysprite" );

Oh, and you'll need to change your iMap (PREF_COLORMAP_I_MAP) value in your Prefs file to simply "i". Otherwise none of this will work.

The result will look something like this:

Image

Time consuming, yes, but effective. I think there are a few artifacts here and there due to transparency settings in Foreground images. I didn't try it as a background image. Let me know what you guys think!

Best,

Duncan

Post Reply