1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

PIC and PAL files viewer?

Discussion in 'Civ1 - General Discussions' started by 10lire, Jun 6, 2007.

  1. 10lire

    10lire Prince

    Joined:
    Mar 5, 2003
    Messages:
    304
    Location:
    Milan, Italy, EU
    Does somebody know if is there a tool able to view the Civ's *.PIC and *.PAL image files in the root civ directory?
     
  2. stwils

    stwils Emperor

    Joined:
    Apr 5, 2001
    Messages:
    1,151
    Location:
    Georgia, USA
    What are the *.Pic and *.Pal? Can anyone show images here on the forum?

    stwils
     
  3. 10lire

    10lire Prince

    Joined:
    Mar 5, 2003
    Messages:
    304
    Location:
    Milan, Italy, EU
    They are the graphic files of Civilization; I suppose that the *.pic files contain the image data, and the *.pal files contain the color palettes; in fact almost all the *.pic files have a corresponding *.pal file; i say "almost" because some *.pic files have no corresponding *.pal file.

    I tried to open them with some graphic format but they didn't "recognize the format"... :(

    Click on the image to view a part of the contente of the civ root folder
     

    Attached Files:

  4. stwils

    stwils Emperor

    Joined:
    Apr 5, 2001
    Messages:
    1,151
    Location:
    Georgia, USA
    Thanks. (I can't really see what they are...)

    By the way, your English is fine. :)

    stwils
     
  5. Alex Johnson

    Alex Johnson Warlord

    Joined:
    Dec 13, 2005
    Messages:
    233
    Location:
    Texas
    I don't know how to display the .PIC files, but I would bet that they are RLE encoded pictures. Take the BIRTH*.PIC as examples. Each file should be the same image size, since I'm betting these are the intro sequence when you start a new game (the birth of a world). But the file sizes are different. It should be easy to write a viewer for them if we could figure out how the data is stored. I've written many RLE encoders/decoders in the past. We just need to know the little details, the specifics of how they represent runs, where they put image size data, etc.
     
  6. Ifrit9

    Ifrit9 Chieftain

    Joined:
    May 18, 2005
    Messages:
    82
  7. 10lire

    10lire Prince

    Joined:
    Mar 5, 2003
    Messages:
    304
    Location:
    Milan, Italy, EU
  8. Dack

    Dack Terra Form Moderator

    Joined:
    Nov 26, 2003
    Messages:
    532
    Location:
    civ dos 474.05

    I took a little look at the PAL files each is 782 bytes. Assuming that each of the 256 colors is made up of 3 bytes, one byte for each RGB. 3 * 256 = 768 so the extra 14 bytes must be some sort of header info.

    Sometime after reading your post, I was riding along and I starting thinking about the PIC file format. It hit be like a ton of bricks the palette information is not stored in the PIC file after all. See the thread PIC file format


    I had been searching to find the format of other files named PIC thinking that CIV DOS was using some standard (previously defined format) format.
     
  9. Ifrit9

    Ifrit9 Chieftain

    Joined:
    May 18, 2005
    Messages:
    82
    The only acceptable solution that I've found is to start DOS shell (at least cmd.exe) and use one of the old DOS screen-grabbers.

    Btw I've already saved all graphics from CIV's .PIC files in GIF format, so I can just email it to you or upload here. Unfortunately PIC.EXE has a bug, due to which there're few defects in some of the resultant images.
     
  10. Dack

    Dack Terra Form Moderator

    Joined:
    Nov 26, 2003
    Messages:
    532
    Location:
    civ dos 474.05
    An alternate method:
    Install dosbox
    Copy PIC.EXE to c:\mps\civ
    In XP, click start, accessories, command prompt
    At the prompt enter the following two lines:
    cd C:\Program Files\DOSBox-0.65
    dosbox -c "mount c \mps\civ\" -c "c:" -c


    at the c:> prompt
    c:>PIC ARCH.PIC

    After the PIC file is displayed CTRL-F5 will produce a file in
    C:\Program Files\DOSBox-0.65\capture
    With a name something like this pic_000.png
    Then a space key and you will get the c:> prompt again

    In what files did you find these errors?
    Did they appear on the screen or only in the saved file?

    Note: Your dosbox version may differ from the example

     
  11. 10lire

    10lire Prince

    Joined:
    Mar 5, 2003
    Messages:
    304
    Location:
    Milan, Italy, EU
    Thank you if you email me the files or if you uploadad them here.. (i don't know any "DOS screen-grabber")

    Thank you!! it works!! :goodjob:

    The files with defects (one or more horizontal or vertical black lines) are:
    BACK1A.PIC
    BACK2A.PIC
    BIRTH5.PIC
    BIRTH7.PIC
    CBACK.PIC
    CBACKS1.PIC
    CBACKS2.PIC
    CBACKS.PIC
    CUSTOM.PIC
    DISCOVR1.PIC
    HILL.PIC
    ICONPGC.PIC
    ICONPGT1.PIC
    ICONPGT2.PIC
    KING12.PIC (a green line under the left eye of Washington; is it native american painting? :))
    SAD.PIC

    Ifrit9, Dack: :worship: :bowdown: i salute you! :) :)
     
  12. Ifrit9

    Ifrit9 Chieftain

    Joined:
    May 18, 2005
    Messages:
    82
    DOSBox method is Ok, but it saves images in PNG format, in which they don't represent original ones by 100.0% (because of PNG compression).

    The file is too big for attachment, so I uploaded it directly: http://forums.civfanatics.com/uploads/58983/CIV1PIC.zip (1.6 MB, 98 files)

    PS. SPRITES.PIC cannot be viewed by PIC.EXE. Maybe it's a non-standard PIC file.
     
  13. Dack

    Dack Terra Form Moderator

    Joined:
    Nov 26, 2003
    Messages:
    532
    Location:
    civ dos 474.05
    PNG format uses a lossless compression.
    i.e. there is no loss of data.
     
  14. Alex Johnson

    Alex Johnson Warlord

    Joined:
    Dec 13, 2005
    Messages:
    233
    Location:
    Texas
    JPG is the only common image file that does not look exactly like the source (because it throws away data to make a smaller file).

    GIF and PNG both use the same basic method (also the same basic method as ZIP files) to compress images, they save all the data, and they always look exactly the same as the original.
     
  15. Ifrit9

    Ifrit9 Chieftain

    Joined:
    May 18, 2005
    Messages:
    82
    My fault, thanks Dack and Alex Johnson. For some reason I thought PNG uses the same methods as TIFF...
     
  16. Whelkman

    Whelkman Phantom Taxman

    Joined:
    Mar 16, 2007
    Messages:
    524
    While TIFF can theoretically house JPEG data, LZW (also used in GIF) and RLE (also used in BMP) lossless compression methods are more common. There's even a hack to stuff DEFLATE (PNG type) data into TIFF as well.
     
  17. Ifrit9

    Ifrit9 Chieftain

    Joined:
    May 18, 2005
    Messages:
    82
    LZW is an alternative option in TIFF, not the default compression method, AFAIK.
     
  18. Whelkman

    Whelkman Phantom Taxman

    Joined:
    Mar 16, 2007
    Messages:
    524
    TIFF has few "default" options; its excessive flexibility is a major factor in its scarcity.
     
  19. krille

    krille CivDOS Fanatic

    Joined:
    Sep 5, 2005
    Messages:
    337
    The corruption is not the biggest problem with PIC.EXE. The fact that it uses a black RGB(0,0,0) background is. This makes it impossible to separate masks (transparent pixels) from actual intended blacks.

    Does anyone know a way to use some color other than black as background for exporting the CivDOS graphics?

    It certainly can.

    The easiest way is to use the command "PIC *.PIC" (if PIC.EXE is located in your CivDOS directory). A (lossless) PNG of SPRITES.PIC is attached.

    SPRITES.PIC looks like CGA, but it definitely has its uses. Intended blacks are not represented as blacks, so this is a way of figuring out at least some of the intended blacks. Most mysteries still remain, however.



    EDIT:
    Here is another modified SPRITES.PNG called SPRITES_CORRECTED_UNIT_COLORS.PNG, in which I have corrected the unit colors (and some of the other colors) to match the VGA colors of the SP257.PNG (check the RAR archive in the next post). The left version is with a colored background, while the right version is with a black background. So this is how the unused unit graphics would've looked for the Zulus and Babylonians, had they been used in the game.



    I wonder if the unused Cavalry unit is carrying a Carbine? I definitely like the look of the two Jets (I would put some bombs under the wings of the rightward one). The Ironclad appears redundant (pretty much unchanged) as does the Knight. The chopper could make a swift and versatile hit-n-run style Gunship unit. I've always thought of the Artillery as a Mobile Artillery unit, but maybe the unused Artillery was really supposed to be the Mechanized Artillery of CivDOS? Or maybe it's just a Mobile Mortar? I don't know, looks nice though.
     

    Attached Files:

  20. krille

    krille CivDOS Fanatic

    Joined:
    Sep 5, 2005
    Messages:
    337
    Here is a RAR archive containing captures of all 106 PIC files using PIC.EXE in DosBox. My game version is v5 (474.05). CivDOS of course.


    EDIT:
    OK, the file names in the old RAR archive were like PIC_000.PNG, PIC_001.PNG, etc. Now I've renamed all 106 PNGs after their proper corresponding PIC files, such as ADSCREEN.PNG, ARCH.PNG, etc. So get the new archive instead (I deleted the old one). Other than that, everything else is the same.

    And yeah, this was done with a "fresh" install. (Install Civilization, apply patch v5 and that's it.)
     

    Attached Files:

Share This Page