
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
PRAW2TGA

by

STRUCTURe 

of

The Immaculate Hood
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8

 
					 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
						Exclusive Distribution

						     BamBam on the Net

			      www.universal.nl/users/magic/sonypsx.htm
					 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8

8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
Special Thanks

to

Hido-Genshi
8 8 8 8 8 8 8 8 8 8 8 8 8 8 8




		 THIS PROGRAM IS FREEWARE!! PASS IT ON!


	    Requests and bug reports to: struct@netcom.com

		  @@@Join the inFREEmation Network@@@



--
BASIC INFORMATION
--

   PRAW2TGA converts PSX raw image files to Targa format.  Currently, 
only 16 and 24 bit files are supported, but this should cover about 75% 
of what's out there (along with TIM2TGA and TIM2BMP).  

Syntax:

   PRAW2TGA {-owhd} infile outfile

	infile = name of raw, uncompressed file
	outfile = name of output targa file
	
	options (all are optional and formatted like -o=#####)

	-o   Sets the offset within the raw file for the image start.
		(example -o=1024)
	-w   Sets the image width.
		(example -w=320 makes the image 320 pixels wide)
	-h   Sets the image height.
		(example -h=480 makes the image 480 pixels tall)
	-d   Sets the bit-depth.
		(example -d=16 signifies a 16 bit image)

	   If not specified, each of the options will try to be auto-
	detected, except for offset which defaults to '0'.  This is not
	always sucessful but works a good percentage of the time.  The
	more values that you give it to start with the more accurate the
	automatic values will be.  See trouble-shooting for more info.

	   The options and file names can occur in any order, but the
	'infile' name must appear before the 'outfile' name.





--
OTHER TOOLS YOU SHOULD HAVE TO USE THIS PROGRAM
--


   If I can I will try to include any other programs that you need to use 
this program.  I may not be able to so here's what I use:


   Sector Editor/Hex Viewer -

	On the Amiga I use FileX.  It's the BEST hex editor I've ever seen.
      I'll try to include it with the archive.  On the PC I know that Norton
      Utilities has a good editor.  I will try to include a program called
      'list' that is a hex viewer.  You probably already have one anyway ;)

   Base Converter -
	
	Something to convert hex addresses given by FileX (hex editor)
      to decimal numbers (base 10)  (i.e. 0xFF = 255).  If your hex
      viewer gives offsets in decimal then you don't need this.  If you
      can do the conversions in your head I will worship you ;)  On the
      Amiga I use a program called 'Calc' which is a multi-base calculator.

   Image Editor/Cropper -

	Something like ImageFX, ADPro, Photoshop, Painter, etc...






--
TUTORIAL (sort of)
--


:Finding RAW graphcs data on PSX discs:

   Look for files that have extensions like PIX, DAT, RAW, IMG, PIC, etc... 
Anything that looks like 'Image' or 'Picture' as an extension.   Another 
good way is looking at the file-size.  See the 'TABLE.TXT' file.
   Look for large '.EXE' files.  Many times at the end of the file there 
will be a title screen.
   

:Identifying Graphics Data:

   Drop the program into your hex viewer and take a look at it.  Look for 
typical graphics data.  If you are unfamilliar with what typical image 
files look like in a hex editor, load up a 16-bit and a 24-bit targa file 
and take a look at the patterns.  You should see a brief bit of garbage at 
the top of the targa file (this is the header) followed by 2 or 3 byte 
patterns.
   If you are looking at an 'EXE' file start at the end and look backwards.  
The mass amounts of '00' at the start are part of the header.


:Identifying Option Info:

   You can try to let PRAW2TGA figure out for its self the depth and width 
and height, but you must give it the offset if there is one.  If you can 
give it the depth it will also have a much easier time.  The Auto-detect 
AI routines work about 75% of the time on 'typical' situation raw image 
files.  At a minimum they should give you a bise to start working from.
   Look for the first offset where the patterns start.  This may be right 
at the top of the file (which means the offset would be '0') or it may 
be in some amount.  Try to pick a place that looks right and use this 
as your starting place.  You can always fine-tune it later.
   To figure out what bit depth the image is look to see if the patterns 
are two bytes or three bytes long.  If they are two then it is 16-bit.  If 
they are three it is 24-bit.  PRAW2TGA can usually figure this out on its 
own under typical conditions, but I found some tricky ones that it 
missed (esp. on Loaded).  It's safe to say that 99% of the time it will 
be 16-bit and not 24-bit.  If you are unsure and PRAW2TGA gives you an error 
auto-detecting depth start with -d=16.



:RUN PRAW2TGA:

  Run the progam and see what you get.  You will find that you use settings
like 'PRAW2TGA -o=0 -w=320 -h=240 -d=16 title.pix title.tga' frequently.





:TROUBLE-SHOOTING AND FINE-TUNING RESULTS:


P: Edges of image are in the middle and the middle is on the edge:

	000000000000000000
	XX0000000000000000
	XXX00000000000000X
	XXXX000000000000XX
	XXX00000000000000X
	XX0000000000000000
	000000000000000000

	  (Your example may not be as extreme)

S: Adjust the offset (-o=) option.


P: Image is offset to the right or left:
S: Same as above

P: Image is Skewed:

	000000000000000000
	000XXXXXXX00000000
	0000XXXXXXX0000000
	00000XXXXXXX000000
	000000XXXXXXX00000
	0000000XXXXXXX0000
	000000000000000000

S: Adjust the width (-w=) option.

P: Top of image is cut off.
S2: There is another file that contains the second half of the image.

P: The Bottom of the file is cut off.
S1: Adjust the offset*
S2: Adjust the height*
S3: There is another file that contains the first half of the image.

*PSX images are stored so that the last line of the file is the first line 
on the screen.  If the bottom is cut off either make the offset smaller of 
the height larger.   It's always better to get a little extra garbage and 
crop the image.


P: Image is there but colors are bonkers and there is/isn't a slight skew.
S: Increase the offset by a small amount.  You may be starting in PRAW2TGA 
   in the middle of a pixel.

P: I can see something but it's all messed up.
S: Play with the Width.  Try using VERY small pixel values like 32 or 16.  
   I've found some images that are long strips of icons. (Resident Evil)

P: There's garbage at the top of the image.
S: Decrease the Height (-h=) option.

P: There's garbage at the bottom of the screen.
S: Increase the Offset (-o=)


!!!HINT HINT HINT!!!!

There's a REALLY nice picture of Jill on the Resident Evil Disc... :)



:SPECIAL NOTE:

  If you have any suggestions for utils, please e-mail them to me.  If 
any1 finds a 24-bit image file PLEASE send it to me.  I am pretty sure 
that the colors on a 24 bit file will not translate correctly, but the 
code's there and I just need an example to test to make sure it works 
right :)

struct@netcom.com


REMEMBER: Shop smart. Shop S-Mart.




