1. PCX verses BMP

Why do a lot of games that I see use PCX files.
Are they easier to use than BMP or faster or simpler.
Can anyone give me the advantages and disadvantages of each.

Thanks in advance
Bernie

new topic     » topic index » view message » categorize

2. Re: PCX verses BMP

BMP is easier to use.
PCX however is nearly identical to BMP however it is
RLE compressed.  Run Length Encoded.
if you have a BMP that looks like below, It can easily be
compressed using RLE.

000100000100002222222000
000100000100000002000000
000100000100000002000000
000100000100000002000000
000100000100000002000000
000100000100000002000000
000100000100000002000000
000111111100000002000000
000100000100000002000000
000100000100000002000000
000100000100000002000000
000100000100000002000000
000100000100000002000000
000100000100002222222000


        Lucius L. Hilley III
        lhilley at cdc.net   lucius at ComputerCafeUSA.com
+----------+--------------+--------------+----------+
| Hollow   | ICQ: 9638898 | AIM: LLHIII  | Computer |
|  Horse   +--------------+--------------+  Cafe'   |
| Software | http://www.cdc.net/~lhilley |  USA     |
+----------+-------+---------------------+----------+
                   | http://www.ComputerCafeUSA.com |
                   +--------------------------------+
----- Original Message -----
From: Bernie Ryan <bwryan at PCOM.NET>
To: <EUPHORIA at LISTSERV.MUOHIO.EDU>
Sent: Sunday, October 10, 1999 2:46 PM
Subject: PCX verses BMP


> ---------------------- Information from the mail
header -----------------------
> Sender:       Euphoria Programming for MS-DOS
<EUPHORIA at LISTSERV.MUOHIO.EDU>
> Poster:       Bernie Ryan <bwryan at PCOM.NET>
> Subject:      PCX verses BMP
> --------------------------------------------------------------------------
-----
>
> Why do a lot of games that I see use PCX files.
> Are they easier to use than BMP or faster or simpler.
> Can anyone give me the advantages and disadvantages of each.
>
> Thanks in advance
> Bernie
>

new topic     » goto parent     » topic index » view message » categorize

3. Re: PCX verses BMP

At 02:46 PM 10/10/1999 -0400, you wrote:
>Why do a lot of games that I see use PCX files.
>Are they easier to use than BMP or faster or simpler.
>Can anyone give me the advantages and disadvantages of each.

PCX is only slightly more complicated than BMP (and so can be loaded almost
as quickly) and has the advantage that for many of the graphics files used
in games, PCX is much smaller than BMP.

PCX works best with files that have only a few colors (say, 4 or 16) or
files that have broad swaths of the same color (e.g., computer-generated
animations).  It does terrible on files with a lot of detail (say,
photographs) and in the worst case can increase file size by 25% over the
original BMP.  In the best case (a file consisting of just one uniform
color) you can get something like 16/1 compression.

The compression works, basically, by counting up how many times the same
color code is repeated in adjacent bytes.  For instance, if the BMP file has

   09 09 09 09 09 09 09 09

then the PCX compressing program notices this repetition and encodes it by
saying "repeat color 09, 8 times".  You can encode this information (color
09, 8 times) in only two bytes, so in this case you save 6 bytes of storage.

To be specific, the PCX encoding of "09 09 09 09 09 09 09 09" would be
something like:

    C8 09

In this case, "C8" signals two things:

   1. The byte following is one that is to be repeated
   2. Repeat it exactly 8 times

In bits, C8 is

      11001000

The upper two bits, when set ("11") signal "the following byte is to be
repeated" and the lower 6 bits "001000" tell how many times to repeat it.

There are some nuances (what do you do if your color code happens to have
the upper two bits set?), but that is the basic idea.

(Also I might have some details slightly mangled as I haven't done anything
with PCX, or even thought about it, for maybe 10 years . . . )

I found an interesting site with specs for all sorts of file formats
(including PCX, PDF, POV, EXE, TIF, TTF, and about every other file format
you can think of):

     http://www.halyava.ru/document/ind_form.htm

Go there and look for "ZSoft PCX File Format Technical Reference Manual".

--Brent


+++++++++++++++++++ Brent Hugh / bhugh at griffon.mwsc.edu ++++++++++++++++++
+   Missouri Western State College Dept of Music, St. Joseph, Missouri   +
+               Piano Home Page: http://www.mwsc.edu/~bhugh              +
+ Internet Piano Concert:  http://cctr.umkc.edu/userx/bhugh/recital.html +
++++++++++ Classical Piano MP3s http://www.mp3.com/brent_d_hugh ++++++++++

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu