Making an optimized set of 8-bit textures with Wally 1.55B
Posted: Sat Dec 02, 2006 12:07 am
Now I've been working on a similar method using Wally 1.55B instead of PSP 4.1x:
1.- Start Wally. Set the Foreground color to, for example, black, and the background color to some color that isn't likely to be used in the textures' color palette. I like to use bright magenta (RGB 255, 0, 255), so I'm going to use it for this example.
2.- Create a new image that is very large, if possible make it a multiple of a power of 2 (for example, 1280x1280), for the type select "Windows Bitmap". Do a "Flood Fill"of the background color over the whole image.
3.- Make sure that in the "Palettes" options ("View->Options->Palettes"), the box labeled "Build optimized palette when pasting/loading 24-bit images" is unchecked. Now, open your existing textures.
4.- Now, if any of your textures exceeds 256x256 pixels, try to see if you can cut it into smaller pieces without actually cutting any shape within the texture. If that's not possible, choose "Image->Resize" and so that the size doesn't exceed 256x256 pixels. Of course, if only one dimension exceeds 256 pixels, you only need to resize that one to under 256 pixels (choose between "Size". "Width" and "Height"accordingly).
5.- Now, if your resulting texture sizes aren't powers of 2 (1, 2, 4, 8, 16, 32, 64, 128, 256), use "Image->Adjust Canvas" Size to bring themto the nearest (lower or higher) ones, both horizontally and vertically. Don't bother with the "Center" checkboxes, apparently they're broken.
NOTE: Since texture coordinates are relative (from 0 to 1, from one corner to the opposite one), if you performed this step, you'll later have to readjust the texture coordinates of your model to match the new texture dimensions. A way to avoid this is to use another program to resize your textures first and paste them into Wally, since Wally is somewhat constrained in this aspect.
6.- Now start copying and pasting each of your textures into the "master canvas" (using the "Edit->Paste->Into Image" option, or CTRL+E). I tend to do that placing them next to each other without any gaps in between, but leaving a portion of the "master canvas" where the "dummy" color (magenta) can still be seen, but this isn't really needed since all you need is to avoid them overlapping. In order to avoid the images to be pasted each over the previous one, you need to select an area on the "master canvas" first (the size of the selection area doesn't really matter, you only need to set the top left edge where you want it to start). If you run out of space while still having textures to paste, use "Image->Adjust Canvas" and set a new width and height (for example, if 1280x1280 wasn't enough, now make it 1536x1536). Leave the "Center" boxes unchecked. With 1280x1280 you should be able to place up to 25 256x256-pixels textures on it, with 1535x1536 it would be up to 36.
7.- Don't close your textures yet, keep them minimized or something.
8.- Now you must save the "master canvas" to keep it safe. Since when you created it you already selected "Windows Bitmap", it will automaticaly be saved as that now. Use a name like "RGBtextures.bmp". Now close it.
NOTE: with all the limitations Wally has, it may be a good idea to do steps 6-8 on a different program, like PhotoFiltre, then continue with step 9 (bus as I mentioned in the NOTE for step 5, you'll need first to paste the resized/cut textures on Wally before proceeding with the next steps).
9.- Now, select "View->Options->Palettes". Check the box labeled "Build optimized palette when pasting/loading 24-bit images" (yes, it's the one I told you to leave unchecked earlier). Also, in "View->Options->Wally", in "Palette Conversion", the "Nearest Color" option should be the one selected.
10.- Now open your "master canvas" file again. It's going to take longer since it will be calculating an optimal palette now. Once it's done, you'll see the new palette on the right side, different from Wally's default one. DO NOT SAVE THE IMAGE AFTER THIS!
11.- Now, select "Colors->Save Palette". Choose "JASC Palette (*.pal)". Enter a name like "8bitPpalette.pal" and click on "Save".
12.- Using your favorite text editor (Notepad, Wordpad, DOS's EDIT, whatever), open the palette file you saved on step 10 (8bitPalette.pal or whatever you called it). Search for the string "255 0 255" (those are the RGB values for magenta, remember?). Cut the whole line that contains that string, go to the start of the file, and paste the line you cut right below the line that says "256" (in other words, you should be pasting the line with the magenta code as the 4th line in the file). Save the changes and close the file.
13.- Back on Wally, you can close the "Master canvas" now, it isn't needed anymore. Don't save the changes.
14.- Now, go through each of your textures (I told you not to close thm - if you did, reopen them), and select "Colors->Load Palette" and open the palette file you just edited. This will convert the texture to an 8-bit image with the first entry of the palette set to the "dummy" color. Select "File->Save as", or if your texture files weren't .BMPs, use "File->Export" and choose "Windows Bitmap (*.bmp)", and save it. Repeat it for all the other textures. (Of course, oing so you're overwriting your old textures, so if you don't want to, make backup copies first, or use a different filename when saving, like "TextureN_8bit.bmp".)
Done! Now you have a set of several textures that share the same palette, and won't change if they're combined with opacity maps. You could also use bright blue (RGB 0, 0, 255) instead of bright magenta for the "dummy" color - that's what GeomAdd (and Trespasser) usually uses when there's an opacity map involved.
1.- Start Wally. Set the Foreground color to, for example, black, and the background color to some color that isn't likely to be used in the textures' color palette. I like to use bright magenta (RGB 255, 0, 255), so I'm going to use it for this example.
2.- Create a new image that is very large, if possible make it a multiple of a power of 2 (for example, 1280x1280), for the type select "Windows Bitmap". Do a "Flood Fill"of the background color over the whole image.
3.- Make sure that in the "Palettes" options ("View->Options->Palettes"), the box labeled "Build optimized palette when pasting/loading 24-bit images" is unchecked. Now, open your existing textures.
4.- Now, if any of your textures exceeds 256x256 pixels, try to see if you can cut it into smaller pieces without actually cutting any shape within the texture. If that's not possible, choose "Image->Resize" and so that the size doesn't exceed 256x256 pixels. Of course, if only one dimension exceeds 256 pixels, you only need to resize that one to under 256 pixels (choose between "Size". "Width" and "Height"accordingly).
5.- Now, if your resulting texture sizes aren't powers of 2 (1, 2, 4, 8, 16, 32, 64, 128, 256), use "Image->Adjust Canvas" Size to bring themto the nearest (lower or higher) ones, both horizontally and vertically. Don't bother with the "Center" checkboxes, apparently they're broken.
NOTE: Since texture coordinates are relative (from 0 to 1, from one corner to the opposite one), if you performed this step, you'll later have to readjust the texture coordinates of your model to match the new texture dimensions. A way to avoid this is to use another program to resize your textures first and paste them into Wally, since Wally is somewhat constrained in this aspect.
6.- Now start copying and pasting each of your textures into the "master canvas" (using the "Edit->Paste->Into Image" option, or CTRL+E). I tend to do that placing them next to each other without any gaps in between, but leaving a portion of the "master canvas" where the "dummy" color (magenta) can still be seen, but this isn't really needed since all you need is to avoid them overlapping. In order to avoid the images to be pasted each over the previous one, you need to select an area on the "master canvas" first (the size of the selection area doesn't really matter, you only need to set the top left edge where you want it to start). If you run out of space while still having textures to paste, use "Image->Adjust Canvas" and set a new width and height (for example, if 1280x1280 wasn't enough, now make it 1536x1536). Leave the "Center" boxes unchecked. With 1280x1280 you should be able to place up to 25 256x256-pixels textures on it, with 1535x1536 it would be up to 36.
7.- Don't close your textures yet, keep them minimized or something.
8.- Now you must save the "master canvas" to keep it safe. Since when you created it you already selected "Windows Bitmap", it will automaticaly be saved as that now. Use a name like "RGBtextures.bmp". Now close it.
NOTE: with all the limitations Wally has, it may be a good idea to do steps 6-8 on a different program, like PhotoFiltre, then continue with step 9 (bus as I mentioned in the NOTE for step 5, you'll need first to paste the resized/cut textures on Wally before proceeding with the next steps).
9.- Now, select "View->Options->Palettes". Check the box labeled "Build optimized palette when pasting/loading 24-bit images" (yes, it's the one I told you to leave unchecked earlier). Also, in "View->Options->Wally", in "Palette Conversion", the "Nearest Color" option should be the one selected.
10.- Now open your "master canvas" file again. It's going to take longer since it will be calculating an optimal palette now. Once it's done, you'll see the new palette on the right side, different from Wally's default one. DO NOT SAVE THE IMAGE AFTER THIS!
11.- Now, select "Colors->Save Palette". Choose "JASC Palette (*.pal)". Enter a name like "8bitPpalette.pal" and click on "Save".
12.- Using your favorite text editor (Notepad, Wordpad, DOS's EDIT, whatever), open the palette file you saved on step 10 (8bitPalette.pal or whatever you called it). Search for the string "255 0 255" (those are the RGB values for magenta, remember?). Cut the whole line that contains that string, go to the start of the file, and paste the line you cut right below the line that says "256" (in other words, you should be pasting the line with the magenta code as the 4th line in the file). Save the changes and close the file.
13.- Back on Wally, you can close the "Master canvas" now, it isn't needed anymore. Don't save the changes.
14.- Now, go through each of your textures (I told you not to close thm - if you did, reopen them), and select "Colors->Load Palette" and open the palette file you just edited. This will convert the texture to an 8-bit image with the first entry of the palette set to the "dummy" color. Select "File->Save as", or if your texture files weren't .BMPs, use "File->Export" and choose "Windows Bitmap (*.bmp)", and save it. Repeat it for all the other textures. (Of course, oing so you're overwriting your old textures, so if you don't want to, make backup copies first, or use a different filename when saving, like "TextureN_8bit.bmp".)
Done! Now you have a set of several textures that share the same palette, and won't change if they're combined with opacity maps. You could also use bright blue (RGB 0, 0, 255) instead of bright magenta for the "dummy" color - that's what GeomAdd (and Trespasser) usually uses when there's an opacity map involved.