User blog:Tamamoball/Extracting assets (CG) from arc.nsa files

Extracting assets (CG) from arc.nsa files



This is a guide on how to extract images (and to a smaller extent, voice clips) from arc.nsa files, while preserving the original image quality, including proper transparency.

This method is the best (and likely the fastest) way to obtain high quality, clean looking images for upload to the wiki.

Why not simply have the character pose over a green background and use Magic Eraser to remove the green? Well, consider an image that has transparency, like Promenstein here:













This is what happens if you try to use the magic eraser:









<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">This is the result using my method:

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">Recommended software:


 * Crass (download from http://tlwiki.org/index.php?title=File:Crass-0.4.14.0.bin.7z )

<p class="MsoNormal">*I am using a Windows system, and some things may not work on a different OS.
 * 7-zip or Winrar (7-zip is free, Winrar is not but the trial version allows unlimited unpacking of files)
 * Irfanview (free software, google it)
 * Adobe Photoshop (I use CS2, free alternatives may work, I haven't tried)

<p class="MsoNormal">

Step 1: Data extraction
<p class="MsoNormal">arc.nsa contains the chapter 1 assets, arc1 contains the chapter 2 assets, arc2 the chapter 3 assets, and (correct me if I'm wrong) anything beyond is extraneous and is used by side stories or patches to the game. For example, arc4.nsa contains images for the "Marco's travels" side story.

<p class="MsoNormal">You will need to use an external program to retrieve resources from your arc#.nsa files.

<p class="MsoNormal">Here is how to extract data using Crass. If you are extracting with a different program, the method may differ but you should get the same resulting files.

<p class="MsoNormal">First, extract the crass-0.4.14.0 folder from the .7z file and save it anywhere on your hard drive. Open "CrageGUI.exe". Select "Source file" and browse for the .nsa file which you wish to extract.

Alternatively, if you want to extract all the files at once, move your .nsa files into an empty folder, select "Source path" and browse for the folder where the files are stored.

<p class="MsoNormal">Do not check both the "Source file" and "Source path" boxes at once, or you will just waste your time.

<p class="MsoNormal">If you did not set a destination path, the files will be extracted to the Crass folder.

<p class="MsoNormal">The contents of the .nsa file will be in a folder named the same as the original .nsa file (such as arc2). The original .nsa file will not be deleted or altered.

Step 2: Converting files
The image files will be in .bmp format and the voice clips will be in .ogg format. If you can't play .ogg files, use google to find a player or converter. If you can't view .bmp files, your computer must really suck.

To mass convert images, I recommend using Irfanview. Open Irfanview, and select File -> BatchConversion/Rename. Make sure to actually select the images you wish to convert and click the "Add" button so that they appear in the list of input files.

<p class="MsoNormal">For the background images ("bg" folder), I suggest using .jpg as the output format. Click "Start Batch" and the images will be converted.

<p class="MsoNormal">DO NOT CONVERT THE "chara" FOLDER YET!

<p class="MsoNormal">Note that the original files will not be deleted or overwritten if the filenames of the converted files are different from the originals. "image1.jpg" is considered a different name than "image1.bmp" so after the batch is completed, both the jpg version and bmp version will exist. You may want to delete the .bmp files to save hard drive space.

Step 3: Character image editing preparations
Open the "chara" folder in Windows explorer. Set the view mode to "details". Sort by filesize. Create new folders and name them based on image dimensions (e.g. 1600x600), and place all images that match those dimensions in the corresponding folder.

<p class="MsoNormal">Here is why you should not convert the file format yet: the filesize of a .bmp is length*width*bitdepth. The bitdepth is (correct me if I'm wrong) always 24 here, so all image with the same area will always have the same filesize.

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">However, you do still need to be careful: The same area does not always mean the same dimensions. For example, the vast majority of images have the dimensions 1600x600, which is an area of 960000 pixels and filesize of 2813KB. However, some images have the same filesize but different dimensions - for example, "delh_a_st01.bmp" has the dimensions 1200x800, which gives the same area and filesize as most 1600x600 images. To be sure, click "show more details..." in the bottom info bar of windows explorer and make sure it does not say "(multiple values)" for dimensions.

<p class="MsoNormal">

<p class="MsoNormal">

Step 4 (Final): Character image editing
First of all, I suggest setting Photoshop as your default program to open .bmp files while doing this. It saves some time and effort which can be significant if you're editing a lot of files.

<p class="MsoNormal">Open Photoshop. From my experience you can only edit one image at a time - If you know of a faster way, please tell me.

<p class="MsoNormal">Select the rectangular marquee tool. Change "Style" from "Normal" to "Fixed Size". Change width to EXACTLY HALF of the size of the image you are editing, and height to 2000px or so, as long as it's greater than the size of the image you are editing.

<p class="MsoNormal">Make sure the Layers, Channels, and Tools toolbars are visible. They should be by default.

<p class="MsoNormal">Open the image you want to edit. Maximize your image if it's not already maximized.

(Recording a bot: Optional step, recommended if editing a large amount of images)

'Select Window -> Actions to display the Actions toolbar. Click the "New action" button. Set it to a function key like F2 to easily activate it. Click "Record".'

<p class="MsoNormal">

<p class="MsoNormal">Double-click your Background layer and press OK or select Layer -> New -> Background from layer. Don't bother naming the layer.

<p class="MsoNormal">Click above the right half of your image to select it.

<p class="MsoNormal">Press Ctrl-i to invert.

<p class="MsoNormal">

<p class="MsoNormal">Press Ctrl-x to cut.

<p class="MsoNormal">Press Alt-Ctrl-c to set canvas size. Click the left anchor arrow. Set width to 50% and height to 100%.

<p class="MsoNormal">Select Layer -> Layer Mask -> Hide All (or "Reveal All", doesn't matter)

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">Select the "Channels" toolbar.

<p class="MsoNormal">Show "Layer 0 Mask".

<p class="MsoNormal">Hide "RGB".

<p class="MsoNormal">"Layer 0 Mask" should be active right now. If not, select it so that it is highlighted in blue.

<p class="MsoNormal">

<p class="MsoNormal">

<p class="MsoNormal">Press Ctrl-v to paste.

<p class="MsoNormal">Show "RGB".

<p class="MsoNormal">Hide "Layer 0 Mask".

<p class="MsoNormal">Select Layer -> Layer Mask -> Apply.

Press Shift-Ctrl-s to Save As.

<p class="MsoNormal">Change format to PNG.

<p class="MsoNormal">Click "Save". Interlacing is recommended but not necessary.

<p class="MsoNormal">Press Ctrl-F4 or Ctrl-W to close the image. Don't save.

<p class="MsoNormal">

<p class="MsoNormal">If you took the optional step to record a bot, stop recording at this point.

<p class="MsoNormal">'For any further images with the same width, simply press the hotkey you assigned your bot to, and watch the magic unfold. If switching to an image with a different width, rerecord the bot or just adjust the "Set Selection" step.'

<p class="MsoNormal">

<p class="MsoNormal">You may want to place the image over a background, for example the encyclopedia background. Simply open both the edited character image and the background, then drag the character image onto the background or copy and paste. Make sure to centre the image properly.