Skip to content

arran4/eightbyeight

Repository files navigation

EightByEight Pattern Generator

This project generates PNG images containing grids of 8x8 pixel patterns. It explores different permutations of patterns based on a modular arithmetic logic for colour dithering.

Description

The tool creates a grid where each cell contains a unique 8x8 pattern. It renders a title and labels for the grid. The patterns are generated using a "ColourSource" algorithm that determines the color of each pixel based on its coordinates and a mode index.

Usage

To run the project, you need Go installed.

go run cmd/eightbyeight/main.go

This will generate four files in the current directory:

  • out_bw.png: Classic Black on White
  • out_terminal.png: Green on Black (Terminal style)
  • out_solarized.png: Solarized Light color scheme
  • out_mixing.png: CGA Color Mixing

Output

The output are PNG images with a title, a grid of patterns, and labels.

Examples

Examples of generated patterns can be found in the exampledata/ directory.

Here are the generated outputs:

Classic - Black on White

Classic Output

Terminal - Green on Black

Terminal Output

Solarized Light

Solarized Output

CGA Color Mixing

CGA Mixing Output

Builder

The project includes a GridBuilder to programmatically configure and generate these pattern grids.

import "github.com/arran4/eightbyeight"

// ...

builder := eightbyeight.NewGridBuilder().
    WithTitle("My Custom Grid").
    WithDimensions(10, 5). // 10 rows, 5 columns
    WithColors([]color.Color{color.White, color.RGBA{255, 0, 0, 255}})

img := builder.Generate()
builder.Save("my_grid.bmp")

About

golang based dithering experiments

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages