Help:Making Imagebox Images

From Starbounder - Starbound Wiki
Jump to: navigation, search
This is an {{Itembox}}
Chucklefish fish.png

Above is an Itembox image.
53 x 59 pixels

This guide covers the details of making images for the {{Itembox}}. This is a valuable part of any item page, even for bare-bone stubs, and should be among the first things contributed to an item-page.

To the right is an example of the {{Itembox}} template, the central focal point of which is the image as it is found in game. This guide assumes the reader has operational knowledge of their choice of image editing program, focusing instead on methods than detailed steps.

  1. Locate the item sprite in question
    Here is a guide on unpacking game assets
    Raw game sprites vary in size, but are typically in itemname.png format
  2. Crop the image closely to the sprite
    For animated sprites, see below for details
  3. Scale the image up by the proper factor
    See below for details on how to find this number
    Here is a guide on resizing game sprites properly
  4. Optimize your newly created icon to an indexed GIF or PNG format
    Here is a guide for optimizing pixel-art
    PNG images are the stylistic standard on this wiki for non-animated images
    Lower case file extensions are the stylistic standard on this wiki, and should always be used
  5. Save your image in Page_Name format (very important!)
    If properly optimized, your new image should typically be smaller than 1KB
    Be sure to save with transparency
  6. Upload your new icon to the wiki
    Here is a guide on uploading images to this wiki
    Be sure the image is uploaded with the correct file name!

Finding the right scaling factor

The Itembox can accommodate image-heights up to 110px. It is rare to have a game sprite taller than 110px. For clarity, the image should be as large as it reasonably can. In those instances where the width is the deciding factor, use your best judgement to keep the image inside the box.

When the height is the determining factor, follow this criteria:

  • The scale factor should always be 1, 2, 3, or 4 (100%, 200%, 300%, or 400%)
  • Never scale the image up more than 4 times, smaller items should be kept small (400%)
  • Never scale the image by a decimal, pixel-widths should be consistent across the entire image
  • Choose the largest scale factor possible

In the example to the top right, the image isn't scaled above 1. If the image was scaled to 2, the height of the image would be 118px, exceeding the 110px limit by only 8 pixels.

When the sprite is taller than 110px, which is extremely uncommon, scale the image down so that the height is precisely 110px. Detail in the image will be lost; keeping the height at 110px will prevent excess loss. Even in these circumstances, keep the image aliased to maintain consistency between pages.

Animated images

Animated images should only be uploaded by users who understand the workings of animated gifs, and how to fabricate them in their editing program of choice.

Sprites for animated in-game objects are true sprite-sheets, with each frame of the animation side-by-side in the same image. Keep in mind that sometimes not every sprite in the sheet is used in the animation.

When making animated gifs, open the associated .frames file, responsible for defining the sprite's used frames. Here is an example of one of these files:

{
  "frameGrid" :
    "size" : [32, 24],
    "dimensions" : [5, 1],
    "names" : [
      [ "default.0", "default.1", "default.2", "default.3", "default.4" ]
    ]
  },

  "aliases" : {
    "default.default" : "default.0"
  }
}

The two things that are needed from this file are:

"size"
This designates the width and height (respectively) of each frame
Keep in mind this may include transparent space that should be cropped out for the Imagebox
In the above example, each frame is 32px by 24px
"dimensions"
This indicates the number of frames used
Frames are read left-to-right, then down a row if multiple rows (like a book)
In the above example, 5 frames are used on one row

It is necessary to open a second file, the item's associated .object file to determine the length of the animation:

  "orientations" : [
    {
      "image" : "example.png:<frame>",
      "imagePosition" : [1, 0],
      "frames" : 5,
      "animationCycle" : 0.5,
      "anchors" : [ "background" ]
    }
  ]

This is a small segment of the a .object file, with the final pieces of information:

"frames"
Both files agree there are 5 frames, but they are declared in different ways
"animationCycle"
This is the total length of the animation
Not all animated sprites loop at the same speed
In this example one loop is 0.5 seconds, or 0.1 seconds per frame