Community

The PokéCommunity

We are still working on a better slogan!

Visit Index



Advertise here

Go Back   The PokéCommunity Forums > ROM Hacking > Tools, Tutorials & Resources
Notices

Tools, Tutorials & Resources Various tools to help you develop your hacks can be found here.
New threads in this forum are to be approved by a moderator before they are displayed.

Post Reply
 
Thread Tools
  #1    
Old February 20th, 2010, 04:00 PM
Maco's Avatar
Maco
learning the ropes...
 
Join Date: Feb 2010
Location: Sydney, Australia
Age: 24
Gender: Male
Nature: Careful

Advertise here
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:
Quote:
  • A sprite in a ROM is made up of two parts: a palette and the indexed image itself
  • What is indexing?
    Quote:
    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
    Quote:
    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:
    Quote:



Quote:
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.

Last edited by hashtag; April 15th, 2010 at 07:38 AM.
  #2    
Old February 21st, 2010, 09:04 AM
Chaos Rush's Avatar
Chaos Rush
im sexy and i know it
 
Join Date: May 2007
Location: Taylor Swift
Gender: Male
Nature: Adamant
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.
  #3    
Old February 21st, 2010, 10:06 AM
Tropical Sunlight's Avatar
Tropical Sunlight
The Faltine
 
Join Date: Mar 2008
Location: Slovenia
Age: 18
Gender: Male
Send a message via Windows Live Messenger to Tropical Sunlight
Quote:
Originally Posted by Chaos Rush View Post
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
  #4    
Old February 21st, 2010, 10:08 AM
558122_DG's Avatar
558122_DG
Learning how to make mistakes
 
Join Date: Nov 2009
Gender: Male
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.
  #5    
Old February 22nd, 2010, 01:15 AM
Maco's Avatar
Maco
learning the ropes...
 
Join Date: Feb 2010
Location: Sydney, Australia
Age: 24
Gender: Male
Nature: Careful
Quote:
Originally Posted by Chaos Rush View Post
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.

Quote:
Originally Posted by 558122_DG View Post
good job on your first tutorial
Thanks
  #6    
Old February 28th, 2010, 10:22 AM
The Prince of Sweet Sorrow's Avatar
The Prince of Sweet Sorrow
"If death is your wish..."
Community Supporter
 
Join Date: Feb 2009
Age: 19
Gender: Male
Nature: Lonely
Send a message via Skype™ to The Prince of Sweet Sorrow
Quote:
Originally Posted by Maco View Post
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.
"... prepare to have it granted."
*****

  #7    
Old February 28th, 2010, 10:50 AM
Pokepal17's Avatar
Pokepal17
More cowbell~
 
Join Date: Oct 2008
Location: Steeltown
Age: 20
Gender: Male
Nature: Modest
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
Pokémon Stardrop
  #8    
Old March 2nd, 2010, 05:09 AM
xzibit29's Avatar
xzibit29
It BurnZ
 
Join Date: Feb 2010
Location: In our house
Gender: Male
Nature: Quiet
Send a message via Yahoo to xzibit29 Send a message via Skype™ to xzibit29
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



Click this eggs/hatchlings. Thank you
  #9    
Old March 5th, 2010, 03:05 PM
Maco's Avatar
Maco
learning the ropes...
 
Join Date: Feb 2010
Location: Sydney, Australia
Age: 24
Gender: Male
Nature: Careful
Quote:
Originally Posted by Ray Maverick View Post
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.

Quote:
Originally Posted by Pokepal17 View Post
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.

Quote:
Originally Posted by xzibit29 View Post
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.

Last edited by Maco; March 6th, 2010 at 05:59 PM.
  #10    
Old March 10th, 2010, 05:17 PM
Kronos's Avatar
Kronos
Shooting Star
 
Join Date: Jan 2005
Location: In Jhoto :P
Gender:
Nature: Careful
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]


Last edited by Kronos; March 10th, 2010 at 05:25 PM.
  #11    
Old March 10th, 2010, 09:51 PM
Maco's Avatar
Maco
learning the ropes...
 
Join Date: Feb 2010
Location: Sydney, Australia
Age: 24
Gender: Male
Nature: Careful
Quote:
Originally Posted by Kronos View Post
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.

Last edited by Maco; March 10th, 2010 at 10:58 PM.
  #12    
Old March 11th, 2010, 03:38 AM
Super Hacker's Avatar
Super Hacker
Beginning Trainer
 
Join Date: Mar 2010
Gender: Male
oh, thanx!
when we've repointed some times have bugged or the pokémon or the intro or other image...
but now you show me how to make
  #13    
Old March 11th, 2010, 11:43 AM
Kronos's Avatar
Kronos
Shooting Star
 
Join Date: Jan 2005
Location: In Jhoto :P
Gender:
Nature: Careful
Quote:
Originally Posted by Maco View Post
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]

  #14    
Old March 13th, 2010, 03:15 PM
Opalescent's Avatar
Opalescent
Ninja Mapper
 
Join Date: Mar 2010
Gender: Female
Nature: Quirky
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
  #15    
Old March 13th, 2010, 03:47 PM
Maco's Avatar
Maco
learning the ropes...
 
Join Date: Feb 2010
Location: Sydney, Australia
Age: 24
Gender: Male
Nature: Careful
Quote:
Originally Posted by Opalescent View Post
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.
  #16    
Old March 14th, 2010, 04:41 PM
AxelandDemyx101's Avatar
AxelandDemyx101
Beginning Trainer
 
Join Date: Feb 2010
Gender: Female
Quote:
Originally Posted by Opalescent View Post
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

Last edited by AxelandDemyx101; March 14th, 2010 at 04:58 PM.
  #17    
Old March 15th, 2010, 03:39 AM
Maco's Avatar
Maco
learning the ropes...
 
Join Date: Feb 2010
Location: Sydney, Australia
Age: 24
Gender: Male
Nature: Careful
Quote:
Originally Posted by AxelandDemyx101 View Post
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.
  #18    
Old March 15th, 2010, 04:20 PM
BLAZEQUAZA's Avatar
BLAZEQUAZA
ONE FIERY BEAST
 
Join Date: Sep 2008
Gender: Male
Nature: Serious
Sweet - This is Awesome

THANX!
  #19    
Old March 25th, 2010, 05:18 AM
hack1's Avatar
hack1
Dragon Green
 
Join Date: Jun 2009
Gender: Male
I used same colours but it still gives an error.
  #20    
Old March 25th, 2010, 06:13 AM
Shiny Quagsire's Avatar
Shiny Quagsire
どないやねん, ヤドン
 
Join Date: May 2009
Location: Hoenn Safari Zone
Age: 16
Gender: Male
Nature: Jolly
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.



  #21    
Old March 28th, 2010, 01:33 AM
DingoDD's Avatar
DingoDD
I'll Import your Sprites
 
Join Date: Mar 2010
Location: Kanto
Age: 24
Gender: Male
Nature: Quiet
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?
  #22    
Old March 28th, 2010, 02:06 AM
Maco's Avatar
Maco
learning the ropes...
 
Join Date: Feb 2010
Location: Sydney, Australia
Age: 24
Gender: Male
Nature: Careful
Quote:
Originally Posted by DingoDD View Post
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.
  #23    
Old March 28th, 2010, 03:31 PM
DingoDD's Avatar
DingoDD
I'll Import your Sprites
 
Join Date: Mar 2010
Location: Kanto
Age: 24
Gender: Male
Nature: Quiet
Quote:
Originally Posted by Maco View Post
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?
  #24    
Old March 28th, 2010, 11:18 PM
Shinn_Asuka
Beginning Trainer
 
Join Date: Jun 2007
Gender:
Nature: Adamant
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?
  #25    
Old March 29th, 2010, 04:44 AM
Maco's Avatar
Maco
learning the ropes...
 
Join Date: Feb 2010
Location: Sydney, Australia
Age: 24
Gender: Male
Nature: Careful
Quote:
Originally Posted by DingoDD View Post
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.

Quote:
Originally Posted by Shinn_Asuka View Post
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.
Post Reply
Quick Reply

Sponsored Links


Advertise here
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Minimum Characters Per Post: 25



All times are UTC -8. The time now is 11:09 PM.

About Us
© 2002 - 2014 The PokéCommunity™, pokecommunity.com. Pokémon characters and images belong to The Pokémon Company International and Nintendo. This website is in no way affiliated with or endorsed by Nintendo, Creatures, GAMEFREAK, The Pokémon Company or The Pokémon Company International. We just love Pokémon.

Copyright
All forum styles, their images (unless noted otherwise) and site designs are © 2002 - 2014 The PokéCommunity / PokéCommunity.com. PokéCommunity™ is a trademark of The PokéCommunity. All rights reserved. Sponsor advertisements do not imply our endorsement of that product or service. User generated content remains the property of its creator. Header artwork by Jordanice of deviantART.

Social Media
If you would like to stay up-to-date with us on the go, when we're down, or other such things, follow us on social media sites--most notibly Twitter, Facebook, and Google Plus--by clicking on the links provided.

Design presented by Peitharchia. Special thanks to Hiroshi Sotomura and Ausaudriel.