Milestone 1 of 8

Verify and load supplied images

Check safe manifest identity and supported PNG metadata, then load independent uint8 arrays with explicit row, column, and channel axes.

An array is only useful when its source and shape are known. Start by proving what each supplied image is and what each axis means.

Goal

Verify the image manifest and load supported PNG fixtures into independent arrays with exact shape, dtype, range, mode, and axis contracts.

Inputs

Read the versioned image manifest and the listed PNG files. Each record has a unique image_id, safe relative path, byte count, SHA-256 digest, width, height, and declared Pillow mode. Supported modes are L and RGB.

Represent a grayscale image as (height, width, 1) and RGB as (height, width, 3), with uint8 values from 0 through 255. Axis 0 runs from top to bottom, axis 1 from left to right, and axis 2 follows the declared channel order.

Deliverables

Implement validation and loading in src/config.py and src/load.py (or clearly separated modules). Produce ordered image records containing identity, mode, width, height, shape, dtype, range, and an independent array. Inspect the tiny hand-check patterns before transforming them.

Checks

Reject unsafe paths, missing or extra files, changed bytes, duplicate image IDs, empty dimensions, unsupported modes, and manifest metadata that disagrees with Pillow. Reject arrays with the wrong shape, dtype, range, or channel meaning. Check grayscale and RGB fixtures, one-pixel and narrow images, constant and gradient patterns, and corrupted input.

Mutate a loaded array and verify that the decoded image and a second load are unchanged. Confirm that reading does not modify the manifest or source files.

Workspace

Keep inventory and decoding in src/load.py. Do not implement image transformations or plan execution in this milestone.

Hints

HintDo not infer mode from shape
A shape with three channels does not prove that the source was RGB. Keep the declared mode and decoded metadata.
HintName the top-left pixel
Before transforming a fixture, write down what position (0, 0) means. That convention makes later flips and crops checkable.

Review

Follow one grayscale and one RGB image from manifest record to array. What would be lost if the grayscale channel axis were silently dropped? Which failure should stop the project before any output is written?

How to check your work

Checks compare identity, mode, dimensions, shape, dtype, and range with the supplied fixtures. The loader refuses an ambiguous or changed source instead of guessing.