Skip to content

Instantly share code, notes, and snippets.

@paleite
Created December 4, 2024 10:47
Show Gist options
  • Save paleite/3c8c7633323b470267f81a9de084ff04 to your computer and use it in GitHub Desktop.
Save paleite/3c8c7633323b470267f81a9de084ff04 to your computer and use it in GitHub Desktop.
Image Preparation for Mega Drive Graphics

Steps for Preparing an Image for Mega Drive Graphics

  1. Pick an image with a 10:7 aspect ratio.
  2. Resize it to the Mega Drive's native resolution.
  3. Quantize the image to meet Mega Drive hardware limitations.

Step 1: Picking an Image

The input image should have (approximately) a 10:7 aspect ratio, matching the Mega Drive's NTSC resolution of 320x224.


Step 2: Resizing the Image

Resize the image using the following ImageMagick command:

# Adjust -gravity to control the focus area: center, north, south, east, west, etc.
magick input.png -filter Point -resize '320x224^' -gravity center -extent 320x224 -dither None -remap input.png output.png

This resizes the image to the Mega Drive's resolution using nearest neighbor interpolation (-filter Point) to preserve sharp edges and ensures the output matches the original palette without introducing new colors.


Step 3: Quantizing the Image

Use the Tiled Palette Quantization with the following settings:

  • Tile Width: 8
  • Tile Height: 8
  • Palettes: 4
  • Colors per Palette: 16
  • Bits per Channel: 3
  • Fraction of Pixels: 0.10

Color Index Zero Behavior

Choose either:

  • Shared Color
  • Transparent Color

Dithering

  • Disabled (recommended for cleaner output)
  • Or Slow if dithering is desired, with Dither Weight set between 0.10 and 0.50 (depending on the level of dithering you prefer).

Dither Pattern

Select one that suits your aesthetic preferences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment