Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Contributor Covenant Code of Conduct

## Our Pledge

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.

We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.

## Our Standards

Examples of behavior that contributes to a positive environment for our community include:

- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes
- Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.

Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.

## Scope

This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement by opening a GitHub issue with the label `conduct`. All complaints will be reviewed and investigated promptly and fairly.

All community leaders are obligated to respect the privacy and security of the reporter of any incident.

## Enforcement Guidelines

Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:

### 1. Correction

**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.

**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.

### 2. Warning

**Community Impact**: A violation through a single incident or series of actions.

**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.

### 3. Temporary Ban

**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.

**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.

### 4. Permanent Ban

**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.

**Consequence**: A permanent ban from any sort of public interaction within the community.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 2.0, available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).

For answers to common questions about this code of conduct, see the FAQ at https://www.contributor-covenant.org/faq.
81 changes: 81 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Contributing to Slide Alchemy

First of all, thank you for your interest in contributing! This document will help you understand how to contribute effectively.

## How to Contribute

There are many ways to contribute:

- **Bug reports**: Open an issue describing the problem, your environment, and steps to reproduce.
- **Bug fixes**: Submit a PR that fixes a specific, documented issue.
- **Documentation improvements**: Fix errors, add clarity, or translate existing docs.
- **New reference documents**: Add missing reference docs that help agents execute the workflow more reliably.
- **Script improvements**: Fix bugs or add features to the bundled Python scripts.

## Before You Start

- Python 3.10+ is the only required runtime dependency.
- Install script dependencies from `skill/slide-alchemy/requirements.txt` if you plan to test scripts.

## PR Triage

This is a small project. To respect everyone's time, please follow this guidance:

| Contribution type | What to do |
|---|---|
| Typos, small doc fixes | Open an issue. PRs are welcome but not required for trivial fixes. |
| Bug fixes | PRs are very welcome. Reference the issue number. |
| New features or workflow changes | **Open an issue first** to discuss direction before writing code. |
| Refactoring or structural changes | **Open an issue first.** Large refactors may not align with the project's scope. |

### What we do NOT accept

- Switching from `pip + requirements.txt` to `uv`, `poetry`, or other package managers.
- Adding CI pipelines, test frameworks, or pre-commit hooks. This is intentional for a lightweight skill project.
- Repackaging the skill as a CLI tool, SaaS, or desktop application.
- Mass renames or structural reorganization without prior discussion.

## Contribution Workflow

1. Fork the repository.
2. Create a feature branch from `main`.
3. Make your changes. Keep PRs focused — one concern per PR.
4. If you changed a script, verify it runs without errors.
5. If you changed `SKILL.md` or reference docs, verify the workflow still makes logical sense end-to-end.
6. Submit your PR with a clear description of what changed and why.

## Review Process

- Expect an initial response within a few days.
- If a PR requires more than 2 rounds of changes to converge, it may be closed with a note. This is not gatekeeping — it is protecting your time. You are welcome to resubmit with a clearer direction.
- Keep discussions constructive and focused on the code.

## SVG Compatibility

If your contribution involves SVG generation for the PPTX output, ensure your SVG does not use:

- `<mask>` or `opacity` attributes (PowerPoint does not reliably render them)
- `<style>` blocks with CSS classes (PowerPoint ignores embedded stylesheets)
- `foreignObject` (not supported in PowerPoint SVG import)
- `<use>` with external references (PowerPoint cannot resolve them)
- Non-standard fonts or system-dependent font names

Prefer inline `style` attributes with absolute values (colors as hex, dimensions in px or emu).

## Bug Reports

When filing a bug report, please include:

1. The step in the workflow where the issue occurred.
2. The input (source slide type, page count, etc.).
3. The expected vs. actual behavior.
4. Any error messages or unexpected output artifacts.
5. The AI model and environment you used (if relevant).

## Code of Conduct

Be respectful. Be constructive. We are all here to make slide reconstruction better.

## License

By contributing, you agree that your contributions will be licensed under the MIT License.
90 changes: 85 additions & 5 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<strong>可编辑的 PowerPoint。</strong>
</p>

Slide Alchemy 是一个 Codex Skill,用来把图片型 PPT/PPTX、幻灯片截图、扫描版视觉页面还原成可编辑的 `.pptx`。它不是把整页截图塞回 PowerPoint 后称为可编辑,而是把页面拆成干净底图、可编辑几何形状、生成式 PNG 素材和真实文本框。
Slide Alchemy 是一个 Codex Skill,用来把图片型 PPT/PPTX、幻灯片截图、扫描版视觉页面还原成可编辑的 `.pptx`。它不是把整页截图塞回 PowerPoint 后称为"可编辑",而是把页面拆成干净底图、可编辑几何形状、生成式 PNG 素材和真实文本框。

```text
原始幻灯片图片
Expand Down Expand Up @@ -50,9 +50,18 @@ Slide Alchemy 是一个 Codex Skill,用来把图片型 PPT/PPTX、幻灯片截

## 🎯 为什么需要它

常见图片转 PPT 流程容易有两个问题:
### 与其他方案的对比

1. ❌ 把整页截图放进 PPT,然后说“可编辑”。
| 方案 | 产物 | 文字可编辑 | 几何可编辑 | 图标质量 | 底图质量 |
| --- | --- | --- | --- | --- | --- |
| 整页截图放回 PPT | 图片 PPTX | ❌ 不可编辑 | ❌ 不可编辑 | — | — |
| 全部切 PNG 拼回 | PNG 拼图 PPTX | ❌ 不可编辑 | ❌ 不可编辑 | ⚠️ 易切残 | ⚠️ 白块遮罩 |
| 通用 PPT 转换工具 | 转换后 PPTX | ⚠️ 部分可编辑 | ⚠️ 有限 | ⚠️ 模板替代 | ⚠️ 通用模板 |
| **Slide Alchemy** | **组件化 PPTX** | **✅ 真实文本框** | **✅ 可编辑 OOXML 形状** | **✅ 生成式透明 PNG** | **✅ AI 清理底图** |

### 常见图片转 PPT 流程的问题

1. ❌ 把整页截图放进 PPT,然后说"可编辑"。
2. ❌ 把所有元素都切成 PNG,导致线条、星星、卡片、边框这些简单元素无法编辑,而且图标容易被切残。

Slide Alchemy 使用组件化还原策略:
Expand All @@ -62,24 +71,74 @@ Slide Alchemy 使用组件化还原策略:
- ✅ **复杂图标保持视觉稳定。**
- ✅ **重复组件直接复用。**

## ⚠️ 诚实说明

Slide Alchemy 是一个工具,不是一个许愿池。

- **还原质量取决于源图质量**:模糊、低分辨率或严重压缩的源图会降低所有步骤的输出质量。
- **生成式模型有偏差**:AI 清理底图和生成图标时可能产生细微的风格偏移,不会 100% 复刻原图。
- **文字定位是近似的**:视觉模型提取的文字位置可能有像素级偏移,复杂排版可能需要手动微调。
- **复杂装饰性页面效果有限**:全页插画式设计、手绘风格或重度光效页面的还原效果不如简洁的商务风格页面。
- **模型越弱,人工补偿越多**:使用更强大的视觉/图像模型会显著提升各步骤的输出质量。

如果追求像素级完美还原,Slide Alchemy 可能无法满足。它的目标是:在合理的人工微调范围内,把"完全不可编辑的图片 PPT"变成"大部分可编辑的 PPTX"。

## 📦 安装

让 Codex 从这个仓库安装 skill:
### 前置条件

- Codex(支持 Skill 安装)
- Python 3.10+(脚本依赖)
- 支持图像生成/编辑的 AI 模型

### 安装步骤

1. 让 Codex 从这个仓库安装 skill:

```text
Install the Codex skill from https://github.com/CodingFeng101/slide-alchemy.git
```

安装后重启 Codex。
2. 安装后重启 Codex。

3. (可选)安装脚本依赖:

```bash
pip install -r skill/slide-alchemy/requirements.txt
```

## 🚀 使用

### 基本用法

在 Codex 中调用:

```text
Use $slide-alchemy to convert these image-style PPT slides into an editable PPTX.
```

### 完全自动模式

如果不需要中途确认:

```text
Use $slide-alchemy to convert these slides. Run unattended, no intermediate confirmation.
```

或中文:

```text
用 slide-alchemy 还原这些幻灯片,不要中途确认,全自动运行。
```

### 仅还原指定页面

```text
Use $slide-alchemy to convert pages 1-5 of this PPT into an editable PPTX.
```

> 注意:即使只请求部分页面,工作流仍会完整运行(包括所有页面的底图生成和组件分析),因为组件复用需要全局分析。

## 🧱 元素分类策略

| 分类 | 适合元素 | 输出 |
Expand All @@ -96,6 +155,27 @@ PNG 图标和复杂 PNG 组件必须用图像生成/编辑模型生成素材图

语义图标默认保留为 PNG,即使它是扁平图标或线稿图标。SVG/OOXML 只用于简单版式几何,不用于把可识别图标强行拼成 PPT 原生形状。

## 🗂️ 工作流概览

Slide Alchemy 采用 10 步串行管线,每步有严格的前置验证门:

| 步骤 | 说明 | 交互 |
| --- | --- | --- |
| 1. 源页面渲染 | 获取/渲染源图 | — |
| 2. 底图分组 | 提议分组方案 | ⛔ 需用户确认 |
| 3. 清洁底图生成 | AI 模型生成底图 | ⛔ 需用户确认 |
| 4. 元素分析 | 分类所有非文字元素 | — |
| 5. SVG/OOXML 生成 | 几何元素转可编辑形状 | — |
| 6. PNG 素材图生成 | 图标/复杂元素生成素材 | — |
| 7. PNG 切片 + QA | 裁剪、边缘检查 | — |
| 8. 文字提取 | 视觉模型提取文字 | — |
| 9. PPTX 组合 | 按层序组合最终文件 | — |
| 10. 预览 + QA | 对比源图和结果 | — |

## 🤝 参与贡献

欢迎贡献!请阅读 [CONTRIBUTING.md](CONTRIBUTING.md) 了解如何提交 Bug 报告、修复和功能建议。

## 📄 许可证

MIT
Loading