Lab 05 - Graphics (and a bit of audio)



Basic challenge

The basic challenge is learning how to manipulate images

There is a wide variety of photo/image editing software. In the lab you have installed Pixelmator. There are heaps of tutorials and tons of amazing thing you can do with this software...and most of the functionality is the same as in other popular image editing software, such as GIMP or Photoshop. This tutorial just gives a quick overview of some basic functionality for image processing.

Some things will work well, some won't. Remember, you can always "Undo" the last few actions.

Making shadows

  1. Open Pixelmator (the icon in the Launchpad).
  2. Download testpack.png and Open it in Pixelmator.
  3. Rather than working on this image, you’ll create a new one to work on. While in Pixelmator, from the main menu select File | New. Set the size of the new image to at least 400x400 pixels. The exact size doesn’t matter at this stage; you just need enough room to work with. Press "OK".
  4. Find the "Layers" window and make the "Background Layer" invisible by removing the check-mark beside it.
  5. You should see a new image with a checkerboard pattern. This pattern sits behind your image and it means that the entire image is now transparent.
  6. Go back to the "testpack.png" image (it should still be open in Pixelmator). Find the "Tools" window and select the Rectangular Marquee Tool.
  7. Select the top line of runners sprites from "testpack.png". Copy these to clipboard (⌘command-C), switch to the new image, and paste (⌘command-V).
  8. You can use the Move Tool (top-right of the toolbar) and move the runners into the middle of the image. You can use the Zoom Tool (bottom-left of the toolbar) to zoom in or zoom out. Zoom in a bit to better see what you’re doing.
  9. From the toolbox, select the Color Selection Tool.
  10. The menu bar on the image window is context sensitive -to the selected tool. Right now, it should be showing options for the Color Selection Tool. Select the cog-wheel and make sure to disable the "Smooth Edges" option.
  11. Click and hold on the black background of the runner image. The Color Selection Tool tool select all of the black pixels in the image. While holding the mouse-button down, you can drag the cursor to change the tolerance. Set the tolerance to about 1%.
  12. Let go of the mouse button and you should get a selection of the black pixels around the silhouettes of the runner. Press ⌘command-X (or select Edit->Cut from the main menu) to remove the background.
  13. Find the Layers window. It should list two layers: "Background Layer", which you disabled earlier, and "Layer", which is the layer that got created when you pasted the silhouettes. We won't need the "Background Layer" - you can remove it by right-clicking on it and selecting "Delete".
  14. Make sure "Layer" is selected in the Layers window. From the toolbar select Rectangular Marquee Tool and from the image select one of the frames of the runner. Copy to clipboard.
  15. Now paste: ⌘command-V or Edit->Paste. Initially you may not see any difference, because you’ve pasted the runner on top of where it was previously. Move (the Move Tool) the image so that you can see it.
  16. Notice in the Layers window that your pasted image created a new layer: "Layer 2".
  17. From the main menu select Edit | Flip Vertical. Move the inverted runner until it makes a reflection (see below). Note that you can use the arrow keys for fine placement.
  18. Now, the upside runner is going to be made into a shadow, so the first thing is to blacken it. From the main menu select Image | Color Adjustments.... Find the Effects Browser window that should appear, and select "Hue"
  19. .
  20. In the pop up dialog, slide the Lightness all the way down to -100 to blacken the shadow and press "OK".
  21. That’s a start, but shadows are softer, less precise in general. In the Effects Browser window switch the effect to "Blur" and select Gaussian.
  22. A dialog will pop up where you can adjust the blur. Watch the main image windows to observe the corresponding effect. Adjust the radius of the blur until you’re happy with it and press "OK".
  23. In the Layers window adjust "Layer 2"'s "Opacity" to about 70% to give you a nice, soft, transparent shadow.


Shadows are cool, how about a reflection?.
  1. Select "Layer" in the Layers window. Go back to the image, select, copy to clipboard and past another silhouette. The new image will become "Layer 3". Flip it and line it up with the original.
  2. Next, you want to distort the reflection slightly. In the Effect Browser select "Distortion" effects and double click on "Twirl". The window that will pup up will allow you to manipulate the effect with a combination of "Radius", "Angle", and a dongle-like control that adjusts curvature of the effect.
  3. Reflections tend to get less well defined the further away from the source of the reflection. To simulate this, you can create a layer mask with a gradient effect.
  4. In the Layers, while "Layer 3" is selected, click the cogwheel at the bottom and select "Add Layer Mask".
  5. Click on the mask in the Layers window and from the toolbar select the Gradient Tool.
  6. In the image, click near the foot of the reflection, and drag downwards. Drag to near the head of the reflection. You should see the following effect (if you don't, you might have to select a different gradient type in the context-sensitive toolbar):
  7. If you're not quite happy with it, you can try to distort and warp things a bit more with filters of your choice.

Merging layers

Check the Layers window. It’s quite possible that your shadow and reflection layers are sitting on top of the original sprites. They should really be underneath. In the Layers window, drag the layers around so that "Layer" ends up on top.Once you’ve finished editing layers, it’s often useful to merge them into a single layer. You can select layers for merging, but in this case just merge them all into one by selecting Layer -> Merge All Layers from the main menu.


A very useful tool for touching up images and removing unwanted bits is the Clone Stamp Tool.
  1. Copy the dice from the testpack image into a new image. Delete the background as you did previously.
  2. Select the Clone Stamp Tool.
  3. In the options for the Clone Stamp Tool you can adjust the brush size of the clone stamp. From the tool context menu click on the button that shows the "Brushes" window and select the 7px brush. Close the brush window.
  4. You need to pick the area to clone. Option click on a white part of one of the dice faces – this selects the clone’s origin. Next, try clicking / dragging the mouse over one of the dots on that face. The clone tool copies the image from the area of the origin to where you are dragging. If it doesn't work, make sure that the there is no selection around the dice (from the Color Selection Tools). Play around with this a bit to get the hang of it, removing all the dots off the dice. Remember, you can always undo a mistake!

Adjusting colours

Often you will need to tweak colours, or even completely alter them. This is what you can do in Photoshop.
  1. Copy the smoke effect from the testpack image into a new image and delete the background as you’ve done previously.
  2. Rather than grey smoke, you'll make it a bit more like dust. In the Effects Browser window select "Color Adjustments" and double click on Color Balace. This dialog will let you tweak the levels of red, green and blue channels in the image.
  3. Reduce the amount of blue in the smoke, which will make it more yellow. Drag the bottom marker in the "Color Balance" dialog and you should see the smoke become more yellowy.
  4. Feel free to tweak the other channels to get a feel for how this works, and click "OK" when you’re happy.
  5. From the Effects Browser double-click on "Hue". In the dialog that pops up tweak the Hue, Saturation and Lightness until you get a nice brown dustiness.
  6. Finally, you can use Effects | Gaussian Blur to soften the whole result.


Show your work to the demonstrator for assessment.

Intermediate challenge

- creating images/audio
Intermediate challenge is about creating your own digital content.

Drawings with a tablet

There are two Samsung Galaxy Tab A with S Pen tablets in the department that you can borrow for a limited time. It's an excellent tool for artwork creation - much easier to draw with the pen than with a mouse.
  1. Before login on to the tablet, make sure that "Student" account is selected
  2. Swipe to log on. The tablet has two applications for drawing: Autodesk Sketchbook and Arftflow. You can find the icons for both programs on the home page once you log-in.
  3. In either program you can create artwork by drawing with the S-Pen right on the tablet. You can work off existing pictures, create new ones, use layers...etc. There are plenty of tutorials out there on digital painting, such as Ctrl-Paint series for instance. This lab will not provide instructions on how to use the programs - just how to get the images off of the tablet.
  4. Once you have you're image ready, like the one below done in Artflow, find the option for sharing the image and save it to the device. Remember which directory you saved it to - "Pictures" or "Downloads" or whatever.
  5. Next, plug-in the provided USB dongle (the little USB connector doesn't go all the way in on the tablet, so don't force it). Then plugin a memstick at the other end of the dongle. After a short delay "File Manager" should come up on the tablet screen. Find the directory where you file has been saved. Tap and hold the file, until selection box appears next to it. Select it and click on "More" in the right-hand corner. You should get an option to "Copy" or "Move" the file. Then copy/move it to your USB.
  6. If it's a PSD file (default save mode for Artflow), then you can open that file in Pixelmator and all the layers will be you can continue working on your artwork - adding various effects, and then saving it as PNG. If you saved the artwork in PNG format, you can probably import it to Unity directly.

Drawing with Inkscape

Inkscape is another graphics creation program. While Photoshop is mainly based around working with raster images (pixels), Inkscape is more about editing vector based images. Vector based images have the advantage that they scale to any desired resolution without blurring or ‘pixelating’. Unity has limited support for rendering vector based graphics, SVG files (though there is an SVGAssets plugin that works with the Pro version ). Still, it is often a better option to create assets in vector graphics and save it as a raster image at a resolution appropriate for your game.

One of the coolest sites around...

Rather than write another tutorial like the Photoshop one, someone else has already put together a series of excellent tutorials based around Inkscape. What’s more, they’re aimed at programmers as much as artists. Here’s a good selection, although it’s worth browsing the entire blog at some stage.
  1. Let's get started - with circles
  2. Continue the fun with squares
  3. Bringing in the gradients...
  4. More fun with gradients...
  5. Staying in shape... the Clip Tool...
  6. Creating a game character
  7. Creating a basic face
  8. Character Animation...
  9. Tank Tutorial
  10. Back with a BANG!
Other option for vector graphics

Lab A machines also have a Flash CS3 installed, which has a nice vector editor.


PyxelEdit is an excellent tool for creating pixel-style tiles and animation. Tutorial on how to use it can be found on PyxelEdit's website


Audacity is a software for editing multiple audio tracks, recording sounds, chopping them up, applying effects and exporting to a variety of formats. While doing this lab, think about how you could make sounds for the first assignment. Perhaps try dropping them into the Space Invaders project from yesterday’s lab.

Recording a sound

The machines in the labs all have built in microphones.
  1. Open Audacity.
  2. Click on the big Record button. Audacity will start recording the input from the microphone.
  3. Make a sound! Something traditional like "Testing, testing, 1, 2, 3" or maybe some lightsaber sound effects? Hit the Stop button when you’re done.
  4. You can hit the Play button to listen to your masterpiece. Also, you can drag a selection in the track to play back just that portion:
  5. If the recording is a bit quiet, you can increase the volume with the -/+ slider to the left of the graphic display of your sound.
  6. Often you’ll end up recording far more than you need. It’s fairly easy to trim this down. Select the bit you want to keep, playing the sound back to ensure you have everything you need, and choose Edit | Trim.

Importing a music file

If you have a music file (and the legal right to use it) that you want to use as background music, Audacity can be a handy way to modify it to fit your needs.
  1. Just use File | Open... to load the track you want.
  2. Music files tend to be fairly large. To zoom in and out on the sound’s timeline, you can use the zoom in/out/selection/project buttons on the tool bar.
  3. In the top left, are six buttons that select the current tool. Examples are the Selection (default) tool, for selecting a portion of our sound, Zoom tool for zooming in on the timeline and the Time Shift tool, which slides the entire track back and forth along the time line. Also, the Envelope tool can be used to selectively dampen or make louder parts of the track.

Applying effects

Here’s where we have some fun. Audacity can apply a number of effects to your sound track. Simply select the region you want to apply the effect to, and choose the effect from the Effect menu. Some examples are:
  1. Fade in / out – useful for cleaning up the beginning and ends of a sample, or to make sounds appear to be ‘coming and going’.
  2. Alter Pitch / Tempo – change your voice into a Pixie or an Orc.
  3. Repeat – save yourself some copying and pasting.
  4. Noise Removal – take out background static.

Mixing Tracks

  1. Every time you record a sound in Audacity, it puts it into a new track. If you record more than one track, Audacity will combine them together, allowing you to build up (or ‘layer’) composite sounds.
  2. If you have multiple tracks, then the Cross Fade In and Cross Fade Out effects become useful for mixing one track into another nicely – the basic Fade In and Fade Out won’t give as nice an effect.


  1. Unity supports various types of audio files, which can be exported from Audacity. Typically you’d use wav files for sound effects and ogg files for music or speech.
  2. Try exporting your sounds with different settings to get a feel for how they affect things in terms of quality / file size.


Pick two methods of creating digital content and create your own game assets based on what you learned. For example, you might choose to draw few backgrounds using a tablet and then a couple of characters using Inkscape. If one of your choices is Audacity, create an original piece of music. Show your work to the demonstrator for assessment.

Master challenge


Show your work to the demonstrator for assessment.