Image Editing?

Discussion in 'NDS - ROM Hacking and Translations' started by hikash, Feb 10, 2011.

  1. hikash

    hikash Newbie

    Feb 10, 2011
    Can someone give me some tutorial, How to do an image editing on a ds roms?
  2. habababa

    habababa Advanced Member

    Nov 24, 2010
  3. loco365

    loco365 GBAtemp Guru

    Sep 1, 2010
  4. habababa

    habababa Advanced Member

    Nov 24, 2010
    What you read there could be also be applied to ds romhacking.
  5. FAST6191

    FAST6191 Techromancer

    pip Reporter
    Nov 21, 2005
    United States
    Short version- it is must like any other rom hack in that you figure out how the image is stored and then how to convert it to a more common format or edit it in place.

    Slightly longer version
    That is not that useful though so in more depth.
    Graphics are not as demanding as some things but if you are not careful they can take up a lot of space and resources very quickly. To this end most developers keep things fairly close to the hardware which allows you to decode them quite easily as the hardware is known.

    The hardware takes a little while to learn but as far as you are concerned for a first stab at graphics hacking on the GBA and on the DS there is a 4 bit per pixel mode, an 8 bit per pixel mode and not that is used often a bitmap mode as well.
    The main tool of the graphics editing trade then is a tile editor, much like hex editors many exist with differing abilities and fans.
    Crystaltile2 detailed below has a great one
    I like myself
    Tile molestor is a very popular one
    Have a poke around and you can start to see. Do note GBA 8BPP is not that common (it was not that common on the GBA but the DS uses it all the time).

    What happens in hardware- short version

    The graphics can be split into two broad types called backgrounds (BG) and objects (OBJ- often simply referred to as sprites). Said sprites are usually considered to be blocks and while they are frequently 4 to some power square blocks they can in theory be almost any size. Fonts are especially keen on using odd sizes (fonts also count as images, the DS has a common font format in NFTR however)
    Backgrounds are usually big images that well serve as backgrounds, text is usually part of it.

    Aside from bitmap mode the images are essentially paint by colour images and the thing that holds all the colours is called a "palette". Games frequently change palettes as a simple way to add some variety- this does however mean some edits can have unintended effects.
    Most palettes are stored in the rom somewhere (be it in the binary, the image file you are editing or another file entirely but some palettes are generated or modified at runtime (Mr Driller rainbow blocks providing a great example).

    Most images slot together like a tile puzzle fairly easily but some images have hugely custom layout options and animation routines (hands moving, facial expressions, attack poses/stances and what have you). Phoenix wright being a good example.

    3d images
    3d images assuming you are not dealing with a 2d painting type 3d image do exist for the DS as well- it has 3d capable hardware. Many games (most notable new super mario brothers) use the 3d hardware to create or augment their 2d visuals so it is worth knowing.
    These use their own format in hardware and on the actual DS several common methods exist. One nice thing about 3d however is that with it being mathematical rather than pixel based you can do things to it to change it quite easily once you know how.
    The big DS 3d format is NSMBD but it is not the only one,8407.html is good. is a bit outdated and incomplete but it is nice to see.
    Not so many tools here, the first link has one nsbmd viewer is another

    Annoying things
    At this point compression should be mentioned. The DS has many options but the big three in images are

    packing- mainly for fonts but this takes a simple 2 colour image and packs it down into 1 bit per pixel (many editors will actually support this)
    LZ compression- by far the most common. The DS BIOS actually has a decompression function but there are variations on it (the big three being called type 10, type 11 and type 40). Type 10 is the BIOS one and type 11 appeared a couple of years back in roms but type 40 is new.

    Several tools can handle it including dsdecmp
    codec LZSS
    crystaltile2 (mentioned below)
    Some GBA tools A few even include tile viewers of a sort but do not expect great compression abilities.

    On top of this the image files for DS and other systems that have a filesystem (most modern systems- the GBA was probably the last holdout) can use archive type formats to hold lots of small files in one big file. NARC is a common DS one.

    SDK level editing
    This still is perhaps not as useful as it could be so SDK level editing.
    The DS SDK (called nitroSDK for most purposes) have lots of formats for developers to use for all things. In graphics they often make their own formats but it is worth knowing about the SDK ones.
    (sites appear to be down right now but when it they are up they are a great source of info) You can get the first one on
    A more basic approach,8407.html is worth a read.

    Being common formats several tools can open them.
    To start with there are susie plugins (a plugin format with a fair bit of support)
    crystaltile2 has extensive support (scroll down a bit, this link might change in the coming weeks though so just search the topic if it does),8407.html is worth a read and has a tool.

    There are also minor asides for game specific stuff and guides (mainly for things like pokemon) to use existing tools.
    Something worth a look at
    It is not an SDK format but it is worth knowing and details the thought process quite well.

    It is very ill advised to only learn how to pull apart things as found in the SDK- developers can and will change things and that will leave you in the lurch if you only know how to open known formats.