Files
to-live-photo/README.md
empty d6357c7b32 docs: 添加项目 README
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-03 22:24:17 +08:00

128 lines
3.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Live Photo Studio
> 将任意视频转换为 iOS Live Photo支持锁屏动态壁纸
[![Platform](https://img.shields.io/badge/platform-iOS%20%7C%20iPadOS-blue.svg)](https://developer.apple.com/ios/)
[![Swift](https://img.shields.io/badge/Swift-6.0-orange.svg)](https://swift.org/)
[![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
## ✨ 功能特性
- 📹 **视频转 Live Photo** — 导入相册视频,一键生成系统可识别的 Live Photo
- ✂️ **精准裁剪** — 时长裁剪1~1.5s+ 多比例模板(锁屏/全面屏/4:3/1:1
- 🎨 **AI 超分辨率** — 集成 Real-ESRGAN智能提升画面清晰度
- 🖼️ **封面帧选择** — 滑杆精选最佳静态封面
- 📱 **壁纸引导** — 系统版本适配的设置步骤引导
## 📱 系统要求
- iOS / iPadOS 18.0+
- Xcode 16.0+
- Swift 6.0
## 🚀 快速开始
### 克隆项目
```bash
git clone https://github.com/yourusername/to-live-photo.git
cd to-live-photo
```
### 构建运行
```bash
# 模拟器构建
xcodebuild -scheme to-live-photo \
-destination 'platform=iOS Simulator,name=iPhone 16 Pro' \
build
# 真机 Archive
xcodebuild -scheme to-live-photo \
-configuration Release \
-destination 'generic/platform=iOS' \
-archivePath build/to-live-photo.xcarchive \
archive
```
## 🏗️ 项目结构
```
to-live-photo/
├── Sources/LivePhotoCore/ # Swift Package - 核心库
│ ├── LivePhotoCore.swift # 生成管线、数据模型
│ ├── AIEnhancer/ # Real-ESRGAN 超分辨率
│ └── Resources/ # metadata.mov, ML 模型
├── to-live-photo/ # iOS App
│ ├── Views/ # SwiftUI 视图
│ │ ├── HomeView.swift # 首页导入
│ │ ├── EditorView.swift # 编辑裁剪
│ │ ├── ProcessingView.swift # 处理进度
│ │ ├── ResultView.swift # 保存结果
│ │ └── WallpaperGuideView.swift # 壁纸引导
│ ├── AppState.swift # 全局状态管理
│ └── DesignSystem.swift # Soft UI 设计令牌
└── docs/ # 文档
├── USER_GUIDE.md # 用户手册
├── TEST_MATRIX.md # 测试矩阵
└── APP_STORE_METADATA.md # 上架信息
```
## 🔧 技术架构
### 生成管线
```
normalize → extractKeyFrame → aiEnhance → writePhotoMetadata → writeVideoMetadata → saveToAlbum → validate
```
### 核心参数
| 参数 | 默认值 | 说明 |
|-----|-------|-----|
| 时长 | 0.917s | 与 iPhone 原生 Live Photo 一致 |
| 分辨率 | 1080×1920 | 竖屏最大,可配置兼容模式降至 720p |
| 帧率 | 60fps | 兼容模式可降至 30fps |
| 编码 | H.264 | 兜底策略确保兼容性 |
| HDR | 转 SDR | 壁纸场景更稳定 |
### AI 超分辨率
- 模型Real-ESRGAN x4plusCore ML64MB
- 处理512×512 分块 + 64px 重叠 + 线性混合
- 放大:约 2.25x(输入 512→输出 2048
## 📋 开发规范
### Git 提交类型
- `feat`: 新功能
- `fix`: 修复缺陷
- `refactor`: 重构(行为不变)
- `chore`: 构建、依赖、工具
- `docs`: 仅文档
### 代码规范
- 遵循 `DesignSystem.swift` 令牌,禁止硬编码颜色/间距
- 新增 View 必须包含 `accessibilityLabel`
- 新增 View 必须适配深色模式和 iPad
- 触控目标 ≥ 44pt
## 📄 文档
| 文档 | 说明 |
|-----|-----|
| [CLAUDE.md](CLAUDE.md) | AI 助手指令(宪法文档) |
| [TASK.md](TASK.md) | 里程碑与任务追踪 |
| [docs/USER_GUIDE.md](docs/USER_GUIDE.md) | 用户使用手册 |
| [docs/TEST_MATRIX.md](docs/TEST_MATRIX.md) | 测试用例矩阵 |
## 📜 许可证
MIT License - 详见 [LICENSE](LICENSE)
---
<p align="center">Made with ❤️ for iOS Live Photos</p>