An optimized image format designed around simpler, pixel art images

Overview

The Simple Graphics Format (SGF) is a file format geared towards storing simple images efficiently. Due to its simple nature, it comes with the following limitations:

  • A maximum palette size of 256 colors
  • A maximum image size of 65,535 x 65,535 pixels

Purpose

SGF was created as a way for me to develop an understanding of how file formats are developed and implemented. Through the process of developing SGF, I learned more about Python packages, loading and storing binary data, and how to locate and implement optimization methods.

Download

An image loader for SGF is currently only available to download either directly from GitHub, or as a Python package. I have plans to develop a custom image viewer and image converter. It is likely that these will be the same application.

Python Package

View on Github

Benchmarks

From my first round of testing, I found that SGF is around 64% smaller than PNG, on average. From more extensive testing: _better testing results_

Original Tests

Best Case: 

Average Case: 

Worst Case: 

1.94%

64.03%

167.38%

Extended Tests

Best Case: __

Average Case: __

Worst Case: __

Format

I designed SGF to be fairly simple to implement and understand. Below is the file specification I used

PDF Document

Implementation

The Python version of the SGF image loader was created using the NumPy and Pillow packages. Pillow was used as a medium to load and represent an image in a format agnostic manner. NumPy was used for various utility functions, especially early on.