graphic file formats

Okamijoe

Member
Hello,
I got some questions regarding frame file formats, the manual only touches this subject very briefly:
~OpenBoR supports 256-color (or lower) .bmp, .gif, .pcx or .png files. However, .bmp is too big so choose between the latter. .png is recommended.
Now I'd like to know a bit more about using one file format over the other, what are the advantages of using .png over .gif?
File size? Better handling of the color palettes? Faster loading In-Engine?
Almost every Mod I looked at is using .gif files, so it really makes me wonder if that's just a matter of habit, or are the differences perhaps not that big of a deal?

Another thing I'd like to ask is about proper file handling, as in saving files correctly.
We all use different programs to save our sprites, I use Photoshop and there's a couple of options to choose from when saving a .png file:
NKEqqrk.jpg

Now, what should I choose? Does any of these options have a bad impact on the file, which can result in maybe a bloated file size or bad colors?
Thank you for your help!
 
Okamijoe said:

Hey Okamijoe, you should stick with .png because it is the newer format with better support going forward. So far as tangible advantages go the main one is superior compression. Photoshop (assuming correct settings) will save an 8bit .png at ~80% the size of an identical .gif file. More specialized software like Plombo's Pal Apply can do even better. It adds up pretty fast.

Performance wise you won't see much difference. The .gif format is by definition 8bit, and .png for entity sprites have to be in 8bit mode, so you get the exact same color capability (256 per sprite). Older engine versions load .gif faster, newer engines load .png faster. There is no speed difference at all in actual game play.

The reason .gif still hangs around is simple momentum. When .png support first appeared several years ago, there was already a vast library of modules made with .gif files. Human nature did the rest - existing module authors stayed with what they knew and new authors tended to assume .gif was the standard since that's what they saw used most.

So far as how to save images, here's some basic tips (assuming you are in Photoshop):

  • Never use the "Save", "Save As", or "Quick Export to PNG". These all stuff the file full of useless garbage and make it much larger than it should be - which is why the absurd myth .gif is smaller than .png persists. Always use the "Save for Web" dialog instead.
  • Turn off all Metadata.
  • Don't save with interlacing - that does nothing at all for OpenBOR and just makes bigger files.
  • Just in case you aren't already aware - OpenBOR trims files on the fly as it loads. In other words, don't individually trim sprites the way you would for other engines like Mugen. That's just wasting your time. Pick a reasonable uniform image size for a given sprite set and you're good.

For absolute best results, use Photoshop for editing and Plombo's Pal Apply Tool to take care of palettes. It will drastically speed up your workflow and produces the most optimal files.

HTH,
DC
 
Thank you very much DC, this is some valuable information!
Alright, I tried Save for Web, but there are even more options beside the things you mentioned:

5ByYr2F.png


The Drop-down Menus let me choose from:
- Selective
- Perceptual
- Adaptive
- Restrictive
- Custom
- Black - White
- Grayscale
- Mac OS
- Windows

- Diffusion
- No Dither
- Pattern
- Noise
...as well as the rest you can see on the screenshot.
Which one to choose, which ones to avoid?
 
Just use 8bit 256 color gifs , with pngs in 24 bit you wil lose pallettes/remaps.
256 is enough for pixels, i use 24 bit pngs but they work just for title screens not for stages, i might try 8bit pngs to see the size difference
 
bWWd said:
Just use 8bit 256 color gifs , with pngs in 24 bit you wil lose pallettes/remaps.
256 is enough for pixels, i use 24 bit pngs but they work just for title screens not for stages, i might try 8bit pngs to see the size difference

bWWd, we are talking about 8bit entity sprites, not backgrounds. It's still immaterial. You say "just use .gif" as if it's somehow easier than .png, but the process is identical either way. The benefits of .png vs .gif are small, but they are absolutely free, so it's just silly to choose .gif format.

To answer the question, Okamijoe, use the following settings. Incidentally, the same applies if for whatever reason you choose to use .gif format:

  • No Diffusion
  • Transparency unchecked
  • Metadata None

The other settings can be left default as they don't matter, you'll be overriding them with a color table anyway.

For color table, this depends. If you intend to use Plombo's Pal Apply (and you should), it's really irrelevant. I'll assume you aren't using Pal Apply, which is why you're here. You'll need to load the .act color table you previously created for your group of sprites (so go make one if you haven't already). Now you are ready to save. Record the process and you can automate the whole thing. Have a sandwich while Photoshop works.

OR... just save the .png files however you feel like, so long as they're in 8bit mode. Then run PalApply on them (seeing a theme here?).

DC
 
benefit is size , 256 color png is 10 % smaller than gif but i keep for exaple wip files in png annd final files in gif, thats my only reason to be honest.
I recommend gifa cause pngs are in 8 , 24 and 32 bits,  ita just simplicity reason
 
Back
Top Bottom