Image Parsing

Modules used to analyze and parse an image into a JSON file for the Perler Printer to read.

Image Split

Splits an image up into pegboard sized regions.

../../_images/parse_image.bmp ../../_images/arrow_down.png ../../_images/parse_image_demo.bmp

Naming Conventions

  • Region naming in image_split.py is “row-column”, with “0-0” being the name of the first region.
  • Pixel naming in region_parse.py uses the same convention.
../../_images/region_naming.bmp

Note

Each region has a maximum size of 29 x 29 pixels.

Region Parsing

Outputs a region’s pixel position and color to a JSON file.

../../_images/region_0_1.bmp

Region 0-1

../../_images/arrow_down.png

Output file: resources/json_data/region_data.json

{
        regions : {
                0-0: {
                        0-0: (255,255,255),
                        0-1: (255,255,255),
                        0-2: (255,255,255),
                        0-3: (255,255,255)
                },
                0-1: {
                        0-0: (255,0,0),
                        0-1: (255,0,0),
                        0-2: (255,0,0),
                        0-3: (255,0,0)
                },
                ...