Skip to content

feat: add PNG format support and switch to vibetty-screenshot crate#6

Merged
L-jasmine merged 7 commits into
mainfrom
feat/sync-by-png
Apr 26, 2026
Merged

feat: add PNG format support and switch to vibetty-screenshot crate#6
L-jasmine merged 7 commits into
mainfrom
feat/sync-by-png

Conversation

@L-jasmine

Copy link
Copy Markdown
Collaborator

Summary

  • Replace inline screenshot module with vibetty-screenshot crate
  • Add PNG format support for screen rendering
  • Add --image-format CLI parameter (-f) to choose between JPEG and PNG
  • Upgrade vibetty-screenshot to v0.2.0

Changes

  • Removed ~500 lines of inline screenshot code (canvas.rs, font.rs, theme.rs, utils.rs, mod.rs)
  • Added vibetty-screenshot as a dependency with ab_glyph rendering backend
  • Added CLI parameter -f / --image-format to specify output format
  • Various bug fixes and improvements

🤖 Generated with Claude Code

L-jasmine and others added 7 commits April 22, 2026 23:54
- Rename render_screen_to_jpeg to render_screen_to_image
- Add format parameter to support both JPEG and PNG output
- Add Copy trait to ImageFormat enum
- Use PNG as default format for scroll operations
- PNG preserves transparency (RGBA), JPEG uses RGB only

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove the bundled src/screenshot/ module and depend on the standalone
vibetty-screenshot library (v0.1.0) from GitHub instead. The API is
unchanged — all existing callers in ws.rs work without modification.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add configurable image format (png/jpeg) via CLI flag, defaulting to
jpeg. Propagates through AppState to all rendering call sites: HTTP
screenshot endpoint, WebSocket screen sync, and scroll operations.
Route changed from /screenshot.jpeg to /screenshot.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add image crate back to Cargo.toml (still used by ws.rs for
  resize/crop/encode)
- Remove src/bin/font_render_test.rs (references deleted screenshot
  module)
- Fix state move-after-use by extracting image_format before AppState
  construction

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Disable default features and enable only the ab_glyph feature for
vibetty-screenshot, switching the font rendering backend.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update vibetty-screenshot dependency from v0.1.0 to v0.2.0.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@L-jasmine L-jasmine merged commit 052cd65 into main Apr 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant