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.
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.
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.
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)
},
...