• Welcome, Guest. Please login.
 
November 27, 2024, 02:28:35 AM

News:

If you have problems logging in, contact an administrator.


Maintaining Color for stages, the RGB method

Started by Jango, February 16, 2008, 04:15:23 PM

Previous topic - Next topic

Jango

As most people will tell you, separating an image into multiple pieces is the best way to conserve the background image. However, doing this can be incredibly time-consuming and difficult to align. Furthermore, this won't prevent against color-loss 100% of the time (Mugen can only handle 16-bit colors, and will downgrade anything above that), and will cause problems if your image has non-whole number deltas. Thus, if you don't mind generating lag in your stages on crappy computers, then you can always resort to this method.

Tools Needed:
- Graphics Gale. Although there are other programs that can separate colors, I find this one the easiest to use, and believe it seemingly gives the best results when converting images to lower color depths.

- A program that can convert the image to .pcx (Graphics Gale doesn't support .pcx format)


How to do it

1) Open up your image in Graphics Gale. Here I'm using a DVD screen capture from the Brak Show. Aside from it being, well Brak, the backgrounds use a lot of color.



2) Under All Frames, go to Color Depth, and change it to 16-bit without dithering as a test. The reason for this is because it will show you what the resulting image will look like in M.U.G.E.N, regardless of whether you decide to go with the image break-up method or this one.




As you can see, it looks fine after that preliminary step, so we'll just stay with that. If it looks shitty, undo, and try again and check "dither." It won't look exactly like the source, but that's the best you can do for Mugen.

3) Under All Frames, go to Adjust Color, and under the panel that says "RGB," set Green and Blue to -256 and leave Red as is.




If you did this right, there should be nothing but shades of red in your image. Go back to Color Depth and convert to 8-bit. As there are only shades of red here, it will have no effect on your image. Save it. Then hit "undo" twice.

4) Repeat the previous step, but this time set Red and Blue to -256 and Green to 0. Save under another name.

5) Repeat the previous step, but this time, set Red and Green to -256 and Blue to 0. Save under another name.

6) I'm assuming you now how to do file conversions and SFF compilation so I'll skip those steps. Now we'll move onto how you handle this in your .def file.  Assuming the alignment in the SFF for all the images is exactly the same, your coding would look something like this:


[BG Image 1]
type = normal
spriteno = 0,0
layerno = 0
start = 0,0
delta = 1,0
mask = 0

[BG Image 2]
type = normal
spriteno = 0,1
layerno = 0
start = 0,0
delta = 1,0
trans = add
mask = 0

[BG Image 3]
type = normal
spriteno = 0,2
layerno = 0
start = 0,0
delta = 1,0
trans = add
mask = 0


If you didn't catch on, basically I stacked them on top of each other, but gave the two top-most layers the "trans=add" parameter. What this does is use additive blending to blend the colors together and add the values to each other. This way, the image should come out exactly as what you got when you initially converted the image to 16-bit.

On a side note, just so I don't get complaints about it, plug in your own deltas, I just made those up off the top of my head.

7) Fire up Winmugen and try it out!


---------------------------------------------------------------------------
I'd like to give [E] credit as he was the one that really got me interested in this method, and we spent about an hour tweaking this stuff to make sure it worked its best.

BONUS DOWNLOAD:

As a thank you for reading this tutorial, you can download the stage that I was constructing in this tutorial. It's for Winmugen Plus or any of the older Hi-Res Mugen builds. NON-HIRES BUILDS WILL NOT WORK.

Click Here

Jango

DOUBLE-POSTING BECAUSE THIS IS IMPORTANT.

This method does have a flaw besides performance. If a character uses bgpalfx or allpalfx for an attack you'll get completely white stuff. As an example, this is my Ren Stage with that happening:



As you can see, everything that I applied the method to is white while the elements that don't have this are just inversed. Thus, while this is merely a minor cosmetic problem that doesn't affect gameplay, just be aware that this happens and is entirely Mugen's fault >_> .

Thanks to Sion of Randomselect for pointing this out. I didn't notice it because I don't use a lot of characters with these kinds of effects.