PokéSprite

repository·master·Indexed 21 days ago

https://github.com/msikma/pokesprite

A comprehensive collection of Pokémon box sprites (Gen 7, Gen 8, and unofficial Legends: Arceus versions) and inventory item sprites. The project includes JSON metadata (pokemon.json, item-map.json, and misc.json) for programmatic access, along with technical documentation on downscaling Gen 8 assets, applying contrast modifications to Gen 7 sprites, and handling sprite dimension inconsistencies.

Tokens
3.3K
Snippets
8
Records
18
Agent score
79%

What's inside pokesprite

  1. Overview of PokéSprite sprites and directories

    master

    PokéSprite is a collection of Pokémon box sprites (including custom shiny versions) and inventory/bag item sprites.

    Available Sprite Directories

    DirectoryDescription
    /pokemon-gen7xGen 7 sprites, updated to Gen 8 size and contrast
    /pokemon-gen8Gen 8 sprites (includes older Gen 7 sprites where needed)
    /itemsGen 3–8 inventory items
    /items-outlineGen 3–8 inventory items with Sword/Shield style white outlines
    /miscMiscellaneous sprites (e.g., ribbons, body styles)
    /iconsLegacy 40×30 Pokémon sprites from Gen 6–7

    Item and miscellaneous sprites are organized into subdirectories by type (e.g., berry, evo-item, valuable-item, ribbon).

  2. Understand the structure of Ribbons and Marks data

    master

    Ribbons and Marks data is sourced from Bulbapedia and is stored in the misc.json data file. Each item in the file follows a specific schema that allows for multi-language support and generation-specific sprite paths.

    Key fields in the data object include:

    • name: An object containing official names in different languages (e.g., eng, jpn, jpn_ro).
    • origin_gen: The integer representing the generation in which the item was first introduced.
    • description: An object containing a description of the item, often specifying the generation it applies to (from_gen).
    • files: An object or array of strings containing paths to the sprite files, often categorized by generation (e.g., gen-6, gen-8).
    {
      "name": {
        "eng": "Training Ribbon",
        "jpn": "しゅぎょうリボン",
        "jpn_ro": "Training Ribbon"
      },
      "origin_gen": 6,
      "description": {
        "eng": "A Ribbon that can be given to a Pokémon that has overcome rigorous trials and training.",
        "from_gen": 7
      },
      "files": {
        "gen-6": "ribbon/training-ribbon.png",
        "gen-8": "ribbon/gen8/training-ribbon.png"
      }
    }
  3. Understand sprite dimension inconsistencies

    master

    When using sprites from this repository, be aware that sprite dimensions are not uniform across all Pokémon.

    • Modern Sprites: Since the release of Pokémon Let's Go, Pikachu!/Eevee!, many sprites use a 68×56 format to accommodate more detail and larger sizes.
    • Legacy/Unupdated Sprites: Some Pokémon still use the older 40×30 format (common in Sun/Moon).

    If a Pokémon sprite appears significantly smaller than others in your application, it is likely using the legacy 40×30 format because it has not yet received an update in recent game releases (like Sword/Shield or its DLCs). This typically affects Pokémon that are not fully evolved or are unable to evolve, as new sprites are primarily generated for those categories.

  4. Downscale Gen 8 sprites to 68×56

    master

    Gen 8 sprites are provided in an upscaled 2× format (136×112). To downscale them to the standard 68×56 size, use ImageMagick with nearest-neighbor interpolation to preserve pixel art integrity. Ensure you exclude the gAMA chunk to maintain consistent color rendering.

    magick convert -interpolate Nearest -filter point -resize 50% -define png:exclude-chunk=gAMA $i -depth 32 PNG32:$i
  5. Apply Gen 8 contrast modifications to Gen 7 sprites

    master

    To make Gen 7 sprites consistent with Gen 8, you must apply contrast changes. This involves darkening edges (changing #202020 to #000000) and other grayscales. Most of these color changes primarily affect shiny sprites.

    Important: When using ImageMagick for these conversions, you must prevent it from adding a gAMA block, as this causes images to display differently even if color values are identical. Use the -define png:exclude-chunk=gAMA flag.

    magick convert -fill "#000000" -opaque "#202020" -define png:exclude-chunk=gAMA $i -depth 32 PNG32:$i
  6. Adjust gamma curves and DPI for ribbon sprites

    master

    Ribbon sprites for Gen 4 and below use a different gamma curve than newer games. To normalize these sprites (adjusting gamma and setting them to 72dpi), you can use ImageMagick.

    Note: All ribbons have been padded to 40x40 for consistency. If you specifically need the original Gen 3 dimensions, gen-3 files can be losslessly cropped back to 32x32.

    # Batch process all files in a directory to adjust gamma and set 72dpi
    for n in *.*
      set x (magick identify -verbose "$n")
      set z1 (echo $x | grep -i "484850")
      set z2 (echo $x | grep -i "4a4a52")
      
      # Check if colors associated with the other gamma curve are present
      if begin test -n "$z1"; or test -n "$z2"; end
        # If so, adjust the gamma curve
        magick convert -level 8%,100%,1.0 -define png:exclude-chunk=gAMA "$n" -depth 32 PNG32:"$n"
      end
    end
    
    # To set images to 72dpi specifically:
    # for n in *.*
    #   convert -density 72x72 -units PixelsPerInch -define png:exclude-chunk=gAMA "$n" -depth 32 PNG32:"$n"
    # end
  7. Use up-to-date icons instead of legacy icons

    master
    The icons located in the icons/ directory are considered legacy icons and are unlikely to receive further updates. While they are maintained to prevent breaking external links (such as those in Google Sheets), developers should refer to the main project README to find the location of the most up-to-date icon assets.
  8. Apply recommended offsets for Gen 8 Pokémon sprites

    master

    Since Gen 8, Pokémon box sprites are 68×56 pixels. Because many sprites were padded from below to fit this size, they may appear too far apart when displayed in a grid.

    To mitigate this and create a cohesive look, use the following recommended overlap/offset when rendering adjacent sprites:

    • Left offset: -24px
    • Top offset: -16px

    This setup allows larger sprites (like Gigantamax forms) to overlap slightly without looking cluttered, while bringing smaller sprites closer together.

  9. Use Pokémon sprite metadata from pokemon.json

    master

    The /data/pokemon.json file (referred to as dex.json in some contexts) provides programmatic access to Pokémon data. Each entry contains:

    • idx: The Pokémon index.
    • name: An object containing names in various languages (eng, jpn, and jpn_ro). Note that jpn_ro contains official rōmaji names used in merchandise.
    • slug: An object containing slugs for various languages.
    • gen-7 / gen-8: Objects containing a forms map for that generation.

    The forms object

    Each form (including the default form identified by $ ) can contain these keys:

    KeyMeaning
    is_alias_ofThis form uses the sprite of another form and does not have its own image
    is_unofficial_iconThis sprite is not a verbatim original and has been edited (applies to non-shiny sprites)
    is_unofficial_legacy_iconOnly for the smaller 40×30 legacy sprites
    is_prev_gen_iconThis sprite is actually from an earlier generation
    has_rightA unique right-facing sprite is available (Gen 7 only)
    has_femaleThe Pokémon has visible gender differences
    has_unofficial_female_iconThe female version was custom made

    Note: Shiny sprites are always considered unofficial.

    {
      "idx": "006",
      "name": {
        "eng": "Charizard",
        "jpn": "リザードン",
        "jpn_ro": "Lizardon"
      },
      "slug": {
        "eng": "charizard",
        "jpn": "riza-don",
        "jpn_ro": "lizardon"
      },
      "gen-7": {
        "forms": {
          "$": {
            "has_female": false,
            "has_right": false
          }
        }
      }
    }
  10. Map inventory items using item-map.json

    master

    To link in-game item IDs to their corresponding sprite files, use /data/item-map.json. This file provides a 1:1 mapping.

    Example mapping: "item_0017": "medicine/potion"

    Other related files:

    • /data/item-unlinked.json: Contains sprites not linked to an item ID (mostly duplicates or legacy files).
    • /data/item-legacy.json: A list of old item sprites from previous generations.
  11. Identify unupdated Pokémon sprites

    master

    The docs/notes/unupdated-sprites.md file contains a list of Pokémon sprites that have not yet been updated to the latest generation's style or requirements. When using the pokesprite-images package, be aware that the following Pokémon (and their specific forms) may use older assets:

    • Furfrou: Various styles including kabuki, la-reine, matron, pharaoh, and star.
    • Carbink
    • Diancie: mega form.
    • Hoopa: Standard and unbound forms.
    • Toucannon
    • Gumshoos
    • Crabominable
    • Oricorio: Various styles including pau, pom-pom, and sensu.
    • Wishiwashi
    • Minior: Various shell colors including blue, blue-gen7, green, indigo, orange, red, violet, and yellow.
    • Komala
    • Bruxish
    • Necrozma: ultra form.
  12. Reference unupdated Mega Evolution sprites

    master

    Several Mega Evolution sprites are listed as unupdated in the Gen 8 collection. When requesting these assets, ensure you append the -mega suffix to the Pokémon name in the filename:

    • Steelix Mega: steelix-mega.png
    • Scizor Mega: scizor-mega.png
    • Heracross Mega: heracross-mega.png
    • Houndoom Mega: houndoom-mega.png
    • Tyranitar Mega: tyranitar-mega.png
    https://raw.githubusercontent.com/msikma/pokesprite/master/pokemon-gen8/regular/steelix-mega.png
    https://raw.githubusercontent.com/msikma/pokesprite/master/pokemon-gen8/shiny/steelix-mega.png