Skip to content

2654400439/Paper2Seminar / skills/paper-ppt-orchestrator

paper-ppt-orchestrator

Verified

Build complete fixed-layout academic-paper presentations from a PDF with bundled PPTX and one-page HTML templates. Use for full paper reading, complexity-aware slide budgeting, subsection coverage mapping, figure extraction, TikZ or Matplotlib evidence visuals, deterministic PPTX assembly, and final QA. Trigger for requests to turn a paper PDF into a discussion-group deck, especially 12-16+ page systems, security, networking, or measurement papers.

FileKindSize
SKILL.mdskill md17.9 KB
agents/openai.yamlconfig296 B
assets/one-page-summary.htmlother7.8 KB
assets/seminar-template.pptxbinary572.7 KB
references/content-design.mdmarkdown5.7 KB
references/data-viz.schema.jsonconfig2.9 KB
references/deck-plan.schema.jsonconfig8.5 KB
references/deck-sizing.mdmarkdown3.4 KB
references/environment-compatibility.mdmarkdown2.8 KB
references/feature-registry.jsonconfig1.4 KB
references/figure-extraction.mdmarkdown5.1 KB
references/job-request.defaults.jsonconfig1.6 KB
references/job-request.schema.jsonconfig7.5 KB
references/one-page-template.mdmarkdown3.1 KB
references/qa-gates.mdmarkdown10.0 KB
references/speaker-notes.mdmarkdown3.1 KB
references/template-contract.mdmarkdown5.1 KB
references/tikz-layout.mdmarkdown12.2 KB
references/visual-selection.mdmarkdown6.5 KB
references/workflow.mdmarkdown9.8 KB
requirements-doclayout.txtmarkdown238 B
requirements-ui.txtmarkdown39 B
requirements.txtmanifest68 B
scripts/apply_speaker_notes.pyscript6.1 KB
scripts/build_ppt.pyscript16.3 KB
scripts/crop_author_block.pyscript7.9 KB
scripts/crop_image_region.pyscript2.4 KB
scripts/export_pptx_pages.ps1script1.3 KB
scripts/extract_paper_assets.pyscript22.3 KB
scripts/job_request.pyscript17.1 KB
scripts/make_contact_sheet.pyscript4.0 KB
scripts/paper_ppt.pyscript17.1 KB
scripts/preflight_capabilities.pyscript8.3 KB
scripts/render_data_viz.pyscript14.6 KB
scripts/render_deck_overview.pyscript2.4 KB
scripts/render_one_page_html.pyscript13.4 KB
scripts/render_readability.pyscript4.1 KB
scripts/update_qa_status.pyscript10.1 KB
scripts/validate_deck_plan.pyscript33.9 KB
webapp/__init__.pyscript49 B
webapp/backend.pyscript14.5 KB
webapp/job_runner.pyscript3.2 KB
webapp/streamlit_app.pyscript17.3 KB

scripts/make_contact_sheet.py

View on GitHub
#!/usr/bin/env python3
"""Combine rendered slide images into one high-resolution overview PNG."""

from __future__ import annotations

import argparse
import math
import re
from pathlib import Path

from PIL import Image, ImageDraw, ImageFont, ImageOps


IMAGE_SUFFIXES = {".png", ".jpg", ".jpeg", ".webp"}


def natural_key(path: Path) -> list[object]:
    return [int(part) if part.isdigit() else part.lower() for part in re.split(r"(\d+)", path.name)]


def collect_images(input_dir: Path) -> list[Path]:
    images = [path for path in input_dir.iterdir() if path.is_file() and path.suffix.lower() in IMAGE_SUFFIXES]
    return sorted(images, key=natural_key)


def auto_columns(count: int) -> int:
    if count <= 12:
        return 4
    if count <= 24:
        return 5
    return 6


def load_font(size: int) -> ImageFont.ImageFont:
    for candidate in ("arial.ttf", "msyh.ttc", "DejaVuSans.ttf"):
        try:
            return ImageFont.truetype(candidate, size=size)
        except OSError:
            continue
    return ImageFont.load_default()


def build_contact_sheet(
    image_paths: list[Path],
    output_path: Path,
    columns: int = 0,
    thumb_width: int = 720,
    start_index: int = 1,
) -> dict[str, int]:
    if not image_paths:
        raise ValueError("no rendered slide images found")
    columns = columns or auto_columns(len(image_paths))
    if not 1 <= columns <= 10:
        raise ValueError("columns must be between 1 and 10")
    if not 320 <= thumb_width <= 1200:
        raise ValueError("thumb_width must be between 320 and 1200")

    thumb_height = round(thumb_width * 9 / 16)
    label_height = 42
    gap = 18
    margin = 24
    rows = math.ceil(len(image_paths) / columns)
    cell_height = thumb_height + label_height
    width = margin * 2 + columns * thumb_width + (columns - 1) * gap
    height = margin * 2 + rows * cell_height + (rows - 1) * gap
    canvas = Image.new("RGB", (width, height), "#20252C")
    draw = ImageDraw.Draw(canvas)
    label_font = load_font(24)

    for index, path in enumerate(image_paths):
        row, column = divmod(index, columns)
        x = margin + column * (thumb_width + gap)
        y = margin + row * (cell_height + gap)
        with Image.open(path) as source:
            slide = source.convert("RGB")
            fitted = ImageOps.contain(slide, (thumb_width, thumb_height), Image.Resampling.LANCZOS)
        frame = Image.new("RGB", (thumb_width, thumb_height), "white")
        paste_x = (thumb_width - fitted.width) // 2
        paste_y = (thumb_height - fitted.height) // 2
        frame.paste(fitted, (paste_x, paste_y))
        canvas.paste(frame, (x, y))
        draw.rectangle((x, y + thumb_height, x + thumb_width, y + cell_height), fill="#15191E")
        draw.text(
            (x + 12, y + thumb_height + 6),
            f"Slide {start_index + index:02d}",
            font=label_font,
            fill="white",
        )
        draw.rectangle((x, y, x + thumb_width - 1, y + thumb_height - 1), outline="#66717E", width=2)

    output_path.parent.mkdir(parents=True, exist_ok=True)
    canvas.save(output_path, format="PNG", optimize=True)
    return {"slides": len(image_paths), "columns": columns, "rows": rows, "width": width, "height": height}


def main() -> int:
    parser = argparse.ArgumentParser(description=__doc__)
    parser.add_argument("input_dir", type=Path)
    parser.add_argument("-o", "--output", type=Path, required=True)
    parser.add_argument("--columns", type=int, default=0, help="0 selects 4-6 columns automatically")
    parser.add_argument("--thumb-width", type=int, default=720)
    args = parser.parse_args()
    try:
        paths = collect_images(args.input_dir)
        result = build_contact_sheet(paths, args.output, args.columns, args.thumb_width)
    except (OSError, ValueError) as exc:
        print(f"ERROR: {exc}")
        return 1
    print(
        f"Contact sheet: {args.output} | {result['slides']} slides | "
        f"{result['columns']}x{result['rows']} | {result['width']}x{result['height']}"
    )
    return 0


if __name__ == "__main__":
    raise SystemExit(main())
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 196kUpdated Claude CodeCodexVerifiedInstall