Skip to main content

Fancy Galaxy Code (FGC)

Fancy Galaxy Code (FGC) is an open source standard for fast and reliable data representation while maintaining a nice look and feel.
FGC strifes to serve as a prettier QR-Code straight from the future.
Contributions and integrations into projects are highly appreciated!

PyPI Package
Online FGC Creator

Specification

Data processing

  • 4 Version bits
  • n Data + Hamming Code correction bits

Data representation

General structure

Center point is thick and has a fixed distance to the arc surrounding it, which equals the distance from layer to layer.
The dot in the ring around the center point represents the orientation (0 degrees).
For the exact distance calculations see the code.

Every ring can store up to degrees_per_bit - 1 bits, since the first bit of every layer is always a 0.
The degrees per bit can be looked up:

Layer 1: 20° per bit = 360° / 20° - 1 bits = 17 bits 
Layer 2: 15° per bit
Layer 3: 12° per bit
Layer 4: 10° per bit
... 9, 8, 8, 6, 6, 6, 5, 5, 5, 5, 4, 4, 4, 4, 4 ...
After the last 4° layer (layer 19), every following layer (>= 20) has 3° per bit and can therefore store 360° / 3° -1 bits = 119 bits

Data representation

If the next bit is the same as this bit: Draw an arc
If the next bit is not the same as this bit: Draw a dot

Visual explanation

FGC Explanation

FGC-tools package usage

Install the package via:

pip install fgc-tools

Import the FGCCreator class and create an fgc:

from fgc_tools import FGCCreator

FGCCreator.create_fgc(
    color_inner="#009060", 
    color_outer="#006090",
    data="Example", 
    output_file="example.svg",
    color_background="#ffffff",
    write_data_as_text=True
)

Import the FGCReader and ReadResult class and read an fgc:

from fgc_tools import FGCReader
from fgc_tools import ReadResult

# Read image from file path
read_result:ReadResult = FGCReader.read_image(
    image_path="example.jpg"
)

# Read image from bytes
read_result:ReadResult = FGCReader.read_image(
    image_file=myPreviouslyDefinedByteArray 
)

Code execution

If you want to experiment with the code in this repository, install the requirements first:

pip install -r requirements.txt

Metadata

Release files for fgc-tools 0.0.27

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fgc-tools 0.0.27
File Size Uploaded
fgc_tools-0.0.27.tar.gz 427.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fgc-tools 0.0.27
File Interpreter ABI Platform
fgc_tools-0.0.27-py3-none-any.whl Python 3 none any Details

Total release size: 859.3 kB

Release files / fgc_tools-0.0.27.tar.gz

Download URL fgc_tools-0.0.27.tar.gz
Size 427.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1f3eb6b0f140dcda817a6a6d6166650dec6e281f99b620a303cb5ab2cfb2c031
BLAKE2b-256 checksum
How to use checksums
b927580d1507f29e2f84ddec86d73ee6cad46b1d40ea0b11f931defabfc62bf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release files / fgc_tools-0.0.27-py3-none-any.whl

Download URL fgc_tools-0.0.27-py3-none-any.whl
Size 432.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fdea45ef1ccb0462454996560aaac63f864b9b7457d54e8f9f10d9f2eae10ad6
BLAKE2b-256 checksum
How to use checksums
f6d44e513d105848fef53e3fff0e1d03331bfb321ae9ee234e7fdeb9ec019c18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.8.10

Release history Release notifications | RSS feed

This release

0.0.27 This release

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.19

2 release files

0.0.18

2 release files

0.0.17

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page