Advertiser Content

Maco

learning the ropes...

Age 29
Male
Sydney, Australia
Seen August 2nd, 2010
Posted April 20th, 2010
72 posts
9.7 Years
After looking through every tutorial I could find, each with their own confusing text and some with incomplete steps, I've decided to make my own guide to replacing Pokemon sprites for the GBA generation. I use Photoshop for any spriting, and the ROM is FireRed, so this guide is focused on that.



Before Starting


Tools you will need:
  1. A graphics editing program.
    The most popular program for this is Microsoft Paint, simply because it comes for free with every copy of Windows. Personally I do not recommend it because it is a very basic program, and not that easy to use. I use Photoshop, simply because it is the best graphics editing program money can buy. A decent free alternative is Graphics Gale. (link)
  2. unLZ GBA (link, scroll down to it).
    This little program reads through your Pokemon ROM and displays all the compressed images within the ROM. It also can replace compressed images within the game. (Compressed means that the image file is shrunk in size to save space on the ROM). Every Pokemon sprite and trainer sprite is compressed in the GBA ROMs, so you will need this tool to edit your Pokemon.
  3. Free Space Finder (link, scroll down to it).
    This program does what its name says: it finds free space in your ROM. If your new sprite is bigger than the original sprite, it is impossible to write over the original without ruining the rest of the ROM. Instead, we can write the new picture into the empty space, and tell the game to use that image instead of the original.


Tools you might need (if not using Photoshop):
  1. IrfanView (link)
    This program is primarily for indexing your new Pokemon sprite. I will explain what indexing is and how to do it later in the guide.



Overview


What we are going to do:
  1. Use unLZ to locate a sprite in the ROM, and export this sprite so we can edit it.
  2. Properly colour and index the new edited sprite.
  3. Use Free Space Finder to find a suitable location for the new sprite.
  4. Import the new sprite into the ROM and replace the old one.

General Knowledge and Definitions:
  • A sprite in a ROM is made up of two parts: a palette and the indexed image itself
  • What is indexing?
    An indexed image stores an image as two matrices. The first matrix has the same size as the image and one number for each pixel. The second matrix is called the color map and its size may be different from the image. The numbers in the first matrix is an instruction of what number to use in the color map matrix.
    In our case, the second matrix is in fact our palette.
  • A palette is just a file that contains the colours to be used in the indexed image. For the Pokemon games, a palette can only contain 16 colours. This means your edited sprite can only use 16 colours (one of which must be the background colour, so only 15 usable colours in the palette).
  • For Pokemon sprites, the image file must be 64x64 pixels in size, no more, no less.
  • The first colour in the palette is transparent in-game.
Method


Part 1: Locating and exporting a sprite
  1. Open up your clean ROM with unLZ. Wait a little bit for it to load the images.



    Now you have to find the sprite you wish to replace. Pokemon sprites begin at around Goto 670 in Fire Red (may be different for R/S). Just type in 670, click goto, and click "Next" until you find the sprite you want to replace. I went to Goto 674, Charmander.

  2. Click "Save As" and save the picture as a .png somewhere memorable.
    There, Part 1 done! :)


Part 2: Colouring and indexing the sprite
  1. Make a new document in your graphics editing program. Make sure it is 64x64 pixels in size.
  2. Draw or copy/paste your new sprite into this window. You can use the saved image from Part 1 as reference. Remember to only use 15 colours in the picture. If you accidentally use more than 15 colours, you can use Photoshop/IrfanView to reduce the colours to 15 (more on that later). In my case I created a Charmander in a different pose, based on the sprite from Pokemon Yellow.

  3. Choose a colour for the background of your new sprite. Make sure that this colour is not used in the actual sprite itself. I used a creamy-greeny-white.

  4. Indexing time! This is the hard part, although if you have Photoshop, this is quite easy:
    Spoiler:
    Click Image, Mode, Indexed Colour...
    You will see a box like this come up:



    Uh Oh! As you can see, when the palette is exact (i.e. every colour will be shown in the palette), I have used 17 colours in the image :surprised: If I had done it right, the Colours number should be 16.
    Luckily for me Photoshop has a feature to limit the colours to a certain number (click the drop-down palette menu, click 'Local (Selective)' and type 16 in the colours box)




    If the colours box says 16, you can proceed to the next step.
    Also, untick transparency, since this adds another colour (transparent) to the palette. Pokemon ROMs don't handle transparency in this way, so it'd just be a waste of a palette slot.


    Now that we have a 16-colour image, we have to index it and create the palette. If we just clicked OK now, Photoshop may not put the background colour in the first slot of the palette, which is really bad. The first colour in the palette will be transparent in the game, so we want the creamy-greeny-white colour to be in the first slot.
    Click the drop-down menu under Forced, and choose Custom. Another box will pop up:



    Click the first square in the new box, and a colour selection box will pop up. Click on the background colour of your new sprite, and click OK, OK, OK.




    Guess what? Your new sprite is indexed, ready to be imported into your ROM. Click File, Save As and choose .png in the drop down menu. Save this file somewhere memorable. Proceed to Part 3.

    But what if you don't have Photoshop? Here's my guide to indexing using IrfanView:
    Spoiler:

    Firstly, to index your sprite using IrfanView, open up your sprite in the program.
    Click Image, Decrease Colour Depth. Choose 16 Colors (4 BPP), and make sure the 2 boxes are unticked. Click OK.



    Now click Image, Palette. See the 16 colours there? Remember, the first colour in the palette will be transparent in game. For my Charmander sprite, we want the first colour to be the greeny-creamy-white background colour.



    As you can see from this picture, IrfanView has made the first colour black. So how do we solve this problem? We swap the background colour with the first colour in the palette.

    Click on the background colour in the palette:



    Notice the circled bit in red down the bottom? These are the Red/Green/Blue values identifying that colour. Write this down somewhere. Click on the first colour in the palette and write down its RGB value too. My RGB values ended up being
    Background Colour = [204, 202, 172]
    First Colour = [20, 18, 20]
    Now double-click on the first colour in the palette, a new window will pop up:



    Replace the values in the box (circled in red in the pic) with the values of the background colour you just wrote down. Click OK. Do the same for the background colour, replace its RGB values with the first colour's values. Click OK.

    Now your palette should have the background colour and first colour swapped:



    Click OK again.

    Your sprite will now look messed up. This is normal.

    My sprite looks like this after swapping the colours:



    Just click File, Save As, and save this picture as a .PNG file. Close up IrfanView, and open your graphics editing program. I will use paint just as an example.

    Open up the messed-up version of your sprite you just saved from IrfanView. Also open up the correctly coloured version of your sprite:



    Now just copy all of the correct sprite across to the messed up sprite (I used Ctrl+A, Ctrl+C, then Ctrl+V into the other window):



    Save this fixed up file as a .PNG file. Guess what? Your sprite is now correctly indexed and ready for insertion. Move to the next step :)


Part 3: Finding Free Space
  1. Open up Free Space Finder. Click File, Open ROM, and browse to the ROM you want.
  2. Now look at the file size of the indexed sprite you wish to insert. For my Charmander, it is 3.99KB (let's just round up to 4KB)



    Convert this number to bytes here. In my case, 4KB = 4096 bytes. Enter this value into Free Space Finder, and click search.



    See the "800000" in the box on the right? This is the location in the ROM of some free space big enough to hold you new sprite. There, Part 3 done. We are maybe 20 seconds away from your new sprite being in-game.


Part 4: Importing the New Sprite
  1. Open up unLZ again. Open up the ROM you want. Browse to the sprite you want to replace, for me it is Goto 674 (Charmander).
  2. Now click Import. Browse to your freshly indexed sprite. You should see your new sprite as the picture on the left. Click Write to ROM. Tick all three boxes up top, and change the image offset value to the number that came up in Free Space Finder.





    Click OK, and close unLZ. Open up the ROM in your emulator of choice, and behold the magnificence of your new sprite! Here's how mine turned out:



Bugs Guide

  1. Picture all scrambled, dots/lines randomly everywhere:
    Either your sprite wasn't 64x64 pixels or you have inserted the sprite in a place where there isn't enough room for it. Also, you may have inserted something else over the top of sprite by accident.
  2. Colours all messed up:
    Either you made a mistake with the palette, or just didn't replace it somehow.
  3. Background colour showing:
    Make sure the first colour in your palette is the background colour.
  4. Crashing:
    Probably have inserted the sprite over some important data. Make sure you are using FSF properly, and start afresh with a new ROM.
  5. "Image is not indexed, aborting" error in unLZ:
    Exactly what it says. If you used the IrfanView method to index, make ABSOLUTELY sure you used only 16 colours in the correctly coloured sprite.
Conclusion


Well I sincerely hope this guide works for you. I've tried to integrate the theory of inserting sprites too, instead of just putting up instructions. If you like this guide or have any comments feel free to drop me a message sometime, although I am quite busy at the moment so I mightn't be able to reply.

Special Thanks

...to HackMew, Deviation and other forum members for answering my own noob questions, and for various guides. Thanks to HackMew again for his great toolset too.





:bandit:
Need help replacing Pokemon sprites? Tutorial here. :bandit:
Male
Seen August 19th, 2018
Posted August 19th, 2018
1,312 posts
12.4 Years
You could just save the original sprite as a png file with unLZ, and then paste the new sprite into the png file, since unLZ already indexes the file for you. There's no need for Photoshop.
Age 23
Male
Slovenia
Seen March 30th, 2015
Posted July 24th, 2013
3,577 posts
11.6 Years
You could just save the original sprite as a png file with unLZ, and then paste the new sprite into the png file, since unLZ already indexes the file for you. There's no need for Photoshop.
Unless he wanted to include new colours :)

558122_DG

Learning how to make mistakes

Male
Seen March 2nd, 2019
Posted April 1st, 2010
738 posts
9.9 Years
well, anyways this is a very clear tutorial, and you've described everything nicely ;)
good job on your first tutorial :)
This signature has been disabled.
Spoilers are forbidden in signatures
Please review and fix the issues by reading the signature rules.

You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.

Maco

learning the ropes...

Age 29
Male
Sydney, Australia
Seen August 2nd, 2010
Posted April 20th, 2010
72 posts
9.7 Years
You could just save the original sprite as a png file with unLZ, and then paste the new sprite into the png file, since unLZ already indexes the file for you. There's no need for Photoshop.
I used Photoshop simply because I made the sprite in it, and because it is familiar to me. Also I did use a few different colours for my revamp, as H2O Turquoise said.

good job on your first tutorial :)
Thanks :)

Ray Maverick

Age 24
Male
Seen 30 Minutes Ago
Posted 1 Week Ago
3,392 posts
10.7 Years
I used Photoshop simply because I made the sprite in it, and because it is familiar to me. Also I did use a few different colours for my revamp, as H2O Turquoise said.
Yeah, it is familiar to you, but not everyone owns PhotoShop, so it would be better to use a free programme like IrfanView.

Maco

learning the ropes...

Age 29
Male
Sydney, Australia
Seen August 2nd, 2010
Posted April 20th, 2010
72 posts
9.7 Years
Yeah, it is familiar to you, but not everyone owns PhotoShop, so it would be better to use a free programme like IrfanView.
There are guides for using IrfanView, and I linked to them in case people didn't have Photoshop. But if you're serious about pixel art and mapping you should probably have a copy anyway.

Well done. This is a very detailed tutorial. :3 However, you should include that part to see if you don't need to repoint, because that will save space. :3
Thanks :) Usually with edited sprites they are slightly larger than the originals, so for the most part you'd have to repoint. It's just less confusing this way.

How about if I/you want to change the Fire Red Title Screen pokemon(Charizard)? I can't see one if I use search..please PM me. Thanks
Replacing the Charizard on the title screen is completely different to replacing Pokemon sprites (and a lot harder to explain). There are several guides in this forum to replace it, search for "titlescreen".
Need help replacing Pokemon sprites? Tutorial here. :bandit:

Kronos

Shooting Star

In Jhoto :P
Seen December 11th, 2016
Posted August 9th, 2011
212 posts
14.8 Years
Whenever I try to import the indexed sprite, it gives me an error saying the sprite is not indexed? Do you have any fixes for this?

*edit* Nevermind. Apparently, if transparency is checked, the image will not work. Can you add this so others don't make this same mistake?
Working on:
Physics Major ^^
Pokemon Stardust
Pokemon Worldwake [RPG Xp]

Maco

learning the ropes...

Age 29
Male
Sydney, Australia
Seen August 2nd, 2010
Posted April 20th, 2010
72 posts
9.7 Years
Whenever I try to import the indexed sprite, it gives me an error saying the sprite is not indexed? Do you have any fixes for this?

*edit* Nevermind. Apparently, if transparency is checked, the image will not work. Can you add this so others don't make this same mistake?
Added. I might also do a little section on IrfanView like some people have suggested.
Edit: The IrfanView guide is up. Hope somebody finds this useful.
Need help replacing Pokemon sprites? Tutorial here. :bandit:

Kronos

Shooting Star

In Jhoto :P
Seen December 11th, 2016
Posted August 9th, 2011
212 posts
14.8 Years
Added. I might also do a little section on IrfanView like some people have suggested.
Edit: The IrfanView guide is up. Hope somebody finds this useful.
The tutorial is very useful ^^ It's very straightforward and explains everything nicely.
Working on:
Physics Major ^^
Pokemon Stardust
Pokemon Worldwake [RPG Xp]

Maco

learning the ropes...

Age 29
Male
Sydney, Australia
Seen August 2nd, 2010
Posted April 20th, 2010
72 posts
9.7 Years
This tutorial is fantastic
Mine keeps bugging up though
I'll just have to try and figure out where its going wrong.
This guide makes it a lot easier to spot the errors I make :)
How is it bugging up? I might be able to help.
Are the colours messed up, or the background is showing, etc?
Need help replacing Pokemon sprites? Tutorial here. :bandit:
Female
Seen August 22nd, 2010
Posted March 15th, 2010
3 posts
9.7 Years
This tutorial is fantastic
Mine keeps bugging up though
I'll just have to try and figure out where its going wrong.
This guide makes it a lot easier to spot the errors I make :)
mine is buggy too...The colors arent right sometimes,it looks like a red storm cloud,It crashes everything,its a bad egg,or it just wont change...
~Extro

Maco

learning the ropes...

Age 29
Male
Sydney, Australia
Seen August 2nd, 2010
Posted April 20th, 2010
72 posts
9.7 Years
mine is buggy too...The colors arent right sometimes,it looks like a red storm cloud,It crashes everything,its a bad egg,or it just wont change...
Can't really help you without seeing a screenshot. Adding general bugs guide to the tutorial too.
Need help replacing Pokemon sprites? Tutorial here. :bandit:

Shiny Quagsire

I'm Still Alive, Elsewhere

Age 21
Male
Hoenn Safari Zone
Seen 1 Week Ago
Posted April 17th, 2017
700 posts
10.4 Years
Try inserting it without using FSF. It will give you an error and a number. Open calculator, goto scientific, then go to the hex radio button. Paste your error number. Now click on the dec radio button. Copy that number, and paste it into the dec textbox. Tell me if it helped. :)

Maco

learning the ropes...

Age 29
Male
Sydney, Australia
Seen August 2nd, 2010
Posted April 20th, 2010
72 posts
9.7 Years
Very good tutorial, I just have one question, My backround shows when I send the pokemon out. I followed everything in the tutorial, but when you had to paste the original sprite over the indexed one, it said the image was not indexed when I tried to import on unLZ.gba. help?
Read the bugs guide at the bottom of the tutorial. If it says it isn't indexed after copy/pasting it then you probably have used more than 16 colours. If the background is showing, the background colour is not in the first slot of the palette. You will have to re-index the file and reinsert.
Need help replacing Pokemon sprites? Tutorial here. :bandit:

DingoDD

I'll Import your Sprites

Age 29
Male
Kanto
Seen September 17th, 2010
Posted April 3rd, 2010
10 posts
9.6 Years
Read the bugs guide at the bottom of the tutorial. If it says it isn't indexed after copy/pasting it then you probably have used more than 16 colours. If the background is showing, the background colour is not in the first slot of the palette. You will have to re-index the file and reinsert.
Okay, I just made a sprite with 5 colours including the backround.I followed the steps and made the changes. But it still says image not indexed. Is their any way I could show you?

Maco

learning the ropes...

Age 29
Male
Sydney, Australia
Seen August 2nd, 2010
Posted April 20th, 2010
72 posts
9.7 Years
Okay, I just made a sprite with 5 colours including the backround.I followed the steps and made the changes. But it still says image not indexed. Is their any way I could show you?
You could upload the photo to imageshack, then post the link in this thread.

Ok, this was actually extremely helpful, thanks. Question though, let's say I wanted to take every sprite from Emerald, and put it into FR/LG. Is there a way to do large amounts at once, or can it only be 1 sprite at a time?
I'm not sure, could be possible. Only advice I can give is to search through the help threads or toolbox.
Need help replacing Pokemon sprites? Tutorial here. :bandit:
Advertiser Content