Jun 9, 2011

Tutorial (Part 3): How to Make Your Own Texture Pack

 In Part 1 , I showed you how to extract files from your copy of Minecraft and talked a little bit about what they do and getting set up.
In Part 2, I explained how to use some of the features of GIMP to do anything.
This is Part 3, and in it we're going to actually start making textures (or at least, try to make A texture).

As a disclaimer, this takes some artistic capability as well as functional knowledge of the tools. I can only give you knowledge, not ability.


So, here we go! Open up GIMP and open up the texture file you want to edit. In this case, I'm using "terrain.png," and it's my own custom one. Since I don't want to save over it, I'm going to go ahead and do a "file\save as..." and name it something unique. Doesn't matter what, but for organizational purposes it's best for it be be really unique, and possibly (for your working files) include the date/version number in the "_6_8_11" format after the name and before the file extension. If this is your working file, make the extension ".xcf" or ".psd," depending on whether you're using GIMP or Photoshop (GIMP uses .xcf and .psd, but .xcf is the format it likes best).


Once you've done all that, pick out a texture you're interested in working on. Use the rectangle-select tool to draw a selection box around the texture you want to edit/make changes to, as I have done below with the Stone texture. Zoom into your image if you need to, you need to make 100% sure that you have selected just the one texture and not any others, otherwise you'll either overwrite your other work, or shift your work to the side and it won't render correctly in game. It's not that hard though, you've only got 16x16 pixels to select. 
Selecting the stone texture with the rectangle select tool.



 Once you've got your texture selected, either copy (control-C [PC] or command-C [Mac]) the texture and paste (control-V or command-V) into a new layer or a new image. A new layer would be easiest, and now is as good of a time as any to explain layers:

Layers are what an image-editing program (Like GIMP) use to keep different parts of the image apart. Normal photographs and images don't have layers, and initially opening any regular image format (.gif, .png, .tiff, .jpg, etc.) into GIMP shouldn't create more than one layer in your layer manager (that box on the right hand side of my screen above the brushes, that I've been conveniently ignoring until now) - the Background Layer. However, GIMP's files (.xcf) can use them if you so choose, and they really help keep things organized. Layers are exactly what they sound like- a stack of images layered together, but they don't need to be the same size, shape, color, or really similar in any way. You should use them because that way, rather than make edits to the main image and risk making an irreparable mistake at some point and needing to start over, you can just delete the messed up layer and the rest of the image stays the same.

Hopefully that's enough of an explanation; but how you actually make one is by pasting the texture you just copied, and then hitting the little blank page icon at the bottom left corner of the layer window. That'll turn your "Floating Selection" (which you may have noticed when you pasted) into a new layer the size and shape of your selection. You should experiment with this if you're new to it, see how you can move the layer around independently of the rest of the image, scale it separately, and how - if deleted- the rest of the image is unchanged. So long as that layer is the current, or selected, layer anyway... (you can select different layers and make them current in that window by clicking on their names).



















 Now that you've got your layer made (I made a new page and then pasted and cropped [image\crop to selection] to my pasted image for clarity), zoom way in so you can see the pixels. All 256 of them -unless you're making a so-called "HD Pack." These use higher amounts of pixels per side -32x, 64x, 128x- to get more detail in. I'm not a huge fan since Minecraft was made in 16x, and also since they can be (but aren't always) a huge performance impairment. Having exponentially higher pixel counts will do that because the image is then exponentially larger, and the game has to have it loaded all the time. Hopefully the game's code will be improved in the future to help performance, and this will allow larger texture packs to work with little or no noticeable lag.

In the above image you can see that I'm also opening a window called "Change foreground color." We need to do that to make any meaningful changes to anything - unless we want an "all black" or "all white" texture pack. I did that by clicking on the black square under the toolbox (the current forground color and the color that your tools will use). As an aside, you can click the arrow next to that to switch the foreground and background colors around, and also click the white square (background color) to change it. The tiny black and white box in the other corner will revert foreground and background back to black and white.

In the color window, there are a bunch of sliders, a few different colorful windows, and some other options. I'm mostly interested in the sliders, which I explained a little bit in Part 2. There are actually 2 sets of sliders here, the first set is labeled "H, S," and "V;" while the second set is labeled "R, G," and "B."
HSV sliders control Hue, Saturation, and Value - or Color, Strength of color, and Lightness/Darkness of color. As I explained earlier, Saturation will make a color more or less gray, and Value will make it more white or more black.
RGB sliders control Red, Green, and Blue. I prefer to use HSV because I can make changes to one aspect of color at a time, with RGB I can only add or subtract Red, Green, or Blue, which aren't usually things I want to do (For example, if I want a slate blue and I have a normal blue, I have to turn down both Red and Green -but not all the way- while keeping my Blue in check. With HSV I can do it with the saturation slider.)

 Use the color window to pick a color you want for your texture. For mine, I picked about 50% gray (H:0, S:0, V:50).


















 Once you've got your color, take your pencil tool and color over the existing image. Make sure you're in the right layer, and if you're not hit the "control-z" (command-z) key to undo your mistake (also in Edit\Undo). Also make sure transparency is set to normal and 100% opaque, otherwise your color will not be pure.



















Then pick a new color and a new brush (The pencil can make 1x1 pixel marks with a low scale on almost any brush) and start drawing (with the pencil for now). I'm trying to make a tillable stone texture, so I've made a pattern I think will work and look... well, fine for a tutorial anyway.



















 Here I've switched from the pencil to the brush tool. I've gotten a brush that fades out (the softer edge vs. the harder edge - you can see which brush I've selected in the brush window), and set the transparency to about 30%. I've also selected the area I want to be colored with the magic wand tool and the rectangle select tool - this way I can keep other areas from being affected by my brushing, which might change the effect I was going for. I'm adding roundish-shadows here by simply following along the lines I drew earlier.



















 Ok, here's an important non-artistic step. You'll need to copy your texture onto a new page. Don't worry too much about cropping, but make sure the page is big enough for at least 4 of your image (in a 2x2 grid, like how you make infinite water sources in Minecraft). Read the captions to follow along, but you're copying and pasting layers, and arranging them (with the move tool) to their correct locations.

Copying the image...
And pasting it into a 2x2 grid. Notice the "Floating Layer" I mentioned earlier - and how my selection is currently invisibly because it is outside the current layer's boundary. If this happens, don't worry about it, just click on the "new layer" button and it'll pop right up.
See? Worked out great. Except that the texture didn't...
 As you can see, I made a mistake early on and wouldn't have caught it if we didn't do this step- the texture does not allign properly and looks terrible when it is extended on a larger surface. Looks like I'll need to start over... (I hope your texture is working better) If you're noticing small errors in your texture, copy a 16x16 area from the middle of this image and smooth out the errors, then use that as your actual texture (assuming you're making one that's meant to map in 2 directions- dirt with grass on the side, ladders, rails, chests, and some others aren't meant to map so it may not be an issue if they don't). Always preform this test when you're making a texture that is meant to map.

Mapping is basically just what we've done, it's also called tiling, but it's when you take an image and repeat it an indefinite number of times in any direction.

(There may also be a filter that does this, but I'll let you figure out how to use it)



















So here I've made changes that fix my texture. If you can't see the specific shape, any 16 pixels by 16 pixels (they're larger than one pixel in the image) taken from the above image within the work space will form that pattern. I made it by drawing a shape that I thought would work, then coloring (with the brush and specific regions highlighted) shading into the image. I usually do this by using either multiply or normal (mostly multiply on non-gray images), some percentage of transparency, and Black as my color.



















 Almost done! Once you've gotten your texture set up so that you like it, paste the image back into your original image (unless you're still using a layer, in which case, don't). Rinse and repeat for every texture you wish to change. This can take time and require multiple changes to everything, but that's why you're saving as a .xcf, so you can keep the layers in your image and move things around, right?



















Once you've gotten all the textures set up in a way that makes you happy; it's time to export your image back to a format Minecraft can handle (.png). Since .png files can't handle layers, make sure you right click in the layers window, and click the spot that says "Merge Visible Layers...". This will change your image from multiple images stacked on top of each other to one single image. Hopefully, it'll keep your transparency the same too - if it doesn't you can also use the "Merge Down" option until you get the image down to only one layer.

Once you're happy with everything, Immediately Save as to a new file with a .png extension! Do not play around with your image or accidentally hit "Save" instead - if you do hit "Save" accidentally you can use the undo command to get your layers back and save again to your main file. You can easily overwrite your entire project if you do not do this!

After you've saved, all that's left is putting the file where you can use it. I might go into more detail on that later, but basically, you recreate the file structure you took your file out of (so if you're doing diamond armor, you'd name your .png something like "Diamond_armor.png" and put it in the Armor folder; if you're doing terrain.png like me, you leave it up at the same level as all the folders are at). Select your files you want to make into a pack (Terrain.png, pack.png, \armor, \terrain, \misc, etc. etc.) and zip them. Put that zipped folder into your Minecraft texture packs folder and you should be good to go!

I hope you've enjoyed this tutorial so far, I plan to extend it but figure that this covers most of the basics so I'd share it with you sooner rather than later.

Happy texturing!

1 comment:

  1. I must say, you did a great job here!! Thanks!!

    ReplyDelete