Skip to main content
100%

Gist 0d6feb6953e77b93ee3a119fb200ed34

✓ Published0🌍 Public
Aalbcunha
Last edited Nov 21, 2018
Created on Nov 21, 2018

This example converts a tall image into a table-based OpenDocument (ODT) file by slicing it into horizontal strips of 75 pixels each. It uses Python’s Pillow library (`Image.crop`, `Image.new`) to segment the image, then embeds each slice into the ODT’s `Pictures/` directory via `zipfile`. The code dynamically writes XML content referencing table rows and images, with a helper function to update the archive. It processes all JPG and PNG files in the current directory, producing a spreadsheet-like visual layout from the original raster data.

AI-generated description

Similar vizzes