{
  "id": 16329508,
  "title": "Split a Storyboard Grid Into Clean Frames With Pillow",
  "url": "https://urgent.news/2026/10/24/split-a-storyboard-grid-into-clean-frames-with-pillow",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-24T13:43:38.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/lee_xiaoyuan_a97212d2f33b/split-a-storyboard-grid-into-clean-frames-with-pillow-3966"
  },
  "original_language": "en",
  "account": "To split a storyboard sheet into clean frames using Pillow, you first need to determine the usable area within the image. This is done by subtracting the margins and gaps from the total width and height. For the given example, the sheet measures 1024 x 412 pixels, with a 20-pixel margin on each side and 12-pixel gaps between frames.\n\nThe script starts by checking that the number of rows and columns, as well as the margin and gap sizes, are all positive. It then opens the source image and calculates the usable width and height by applying the margin and gap adjustments. In this case, the usable width turns out to be 320 pixels, and the usable height is 180 pixels.\n\nNext, the script divides the usable dimensions by the number of columns and rows to find the width and height of each individual frame. Here, each frame measures 320 x 180 pixels. The script then creates a new folder to store the output frames. It iterates through each frame, calculating its top-left corner coordinates based on the row and column indices, and saves the cropped frame as a separate image file named with a two-digit sequential number.\n\nFinally, the script generates a JSON manifest file that contains information about the original image, the dimensions of each frame, and a list of the generated frame filenames. This manifest is saved in the same directory as the output frames. Running the script with the example parameters yields a set of 6 frames, each sized at 320 x 180 pixels, stored in the 'shots' folder.",
  "summary": "When I split a storyboard sheet, I want each exported file to start at the edge of the actual frame. Dividing the full image width by the column count also divides the borders and gaps, which can leave strips of neighboring panels in the output. I calculate the usable area first: usable width = image width - 2 * margin - (columns - 1) * gap Then I divide that width by the column count and apply…",
  "key_points": [
    "Determine usable area by subtracting margins and gaps from total dimensions",
    "Calculate frame size based on rows, columns, margin, and gap sizes",
    "Generate JSON manifest with frame information and filenames"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}