Skip to content

Commit 84815c0

Browse files
committed
docs: 添加 Sixel 协议支持
- 在 README 和 README_zh-CN 文件中添加 Sixel 协议支持的说明 - 更新特性列表,增加 sixel_support 特性 - 在使用示例中添加 Sixel 协议的命令 - 更新依赖列表,增加 quantette 和 nohash-hasher 依赖
1 parent a55d92e commit 84815c0

File tree

2 files changed

+29
-7
lines changed

2 files changed

+29
-7
lines changed

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ English | [简体中文](README_zh-CN.md)
1717
- 📏 **Adaptive Sizing**: Automatically scale images to fit terminal window
1818
- ⌨️ **Interactive Pause**: Optional pause after display for convenient viewing
1919
- 🖥️ **Multiple Display Modes**: Support for full-resolution and half-resolution display modes
20-
- 🖥️ **Multiple Terminal Protocol Support**: Support for WezTerm, Kitty, and iTerm2 image protocols
20+
- 🖥️ **Multiple Terminal Protocol Support**: Support for WezTerm, Kitty, iTerm2 and Sixel image protocols
2121
- 🎞️ **GIF Animation Support**: Play GIF animations in terminal
2222
- 🎥 **Video Playback Support**: Play video files in terminal (requires `video_player` feature and FFmpeg)
2323
- 🔊 **Audio Support**: Add audio tracks to GIF animations
@@ -34,6 +34,7 @@ English | [简体中文](README_zh-CN.md)
3434
| reqwest | reqwest | HTTP client library | <span style="color: green">✓</span> |
3535
| gif_player | gif, rodio, crossbeam-channel | Play GIF animations in terminal | <span style="color: green">✓</span> |
3636
| video_player | rodio, ez-ffmpeg, video-rs, crossbeam-channel, **FFmpeg** | Play video files in terminal (requires video feature and FFmpeg) | <span style="color: red">✗</span> |
37+
| sixel_support| quantette, nohash-hasher | Display images using Sixel protocol | <span style="color: green">✓</span> |
3738

3839
## Installation
3940

@@ -139,6 +140,12 @@ image_to_console --protocol kitty file image.jpg
139140

140141
# Display image using iTerm2 image protocol
141142
image_to_console --protocol iterm2 file image.jpg
143+
144+
# Display image using Sixel protocol
145+
image_to_console --protocol sixel file image.jpg
146+
147+
# Display image using Sixel protocol with custom max colors
148+
image_to_console --protocol sixel --max-colors 128 file image.jpg
142149
```
143150

144151
### File Subcommand Options
@@ -200,6 +207,8 @@ image_to_console video --audio path/to/audio.mp3 path/to/video.mp4
200207
- **WezTerm mode** (--protocol wezterm): Use WezTerm's inline image protocol to display original image directly
201208
- **Kitty mode** (--protocol kitty): Use Kitty's inline image protocol to display original image directly
202209
- **iTerm2 mode** (--protocol iterm2): Use iTerm2's inline image protocol to display original image directly
210+
- **Sixel mode** (--protocol sixel): Use Sixel protocol to display images in supported terminals
211+
- **Full-resolution Sixel mode** (--protocol sixel --full-resolution): Use Sixel protocol to display images in supported terminals with full resolution
203212

204213
### Grayscale Modes
205214
- **Grayscale mode** (--no-color): Convert image to grayscale character art display
@@ -238,6 +247,8 @@ Supports most common image formats, including but not limited to:
238247
| [ez-ffmpeg](https://crates.io/crates/ez-ffmpeg) | 0.5.3 | MIT | Video processing (optional) |
239248
| [video-rs](https://crates.io/crates/video-rs) | 0.10.3 | MIT | Video processing (optional) |
240249
| [ndarray](https://crates.io/crates/ndarray) | 0.16.1 | MIT | N-dimensional array (optional) |
250+
| [quantette](https://crates.io/crates/quantette) | 0.3.0 | MIT | Sixel image quantization (optional) |
251+
| [nohash-hasher](https://crates.io/crates/nohash-hasher) | 0.2.0 | MIT | Sixel Fast Hash (Optional) |
241252

242253
## License
243254

README_zh-CN.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- 📏 **自适应尺寸**: 自动缩放图片以适应终端窗口。
1919
- ⌨️ **交互式暂停**: 可选择在显示后暂停,方便查看。
2020
- 🖥️ **多种显示模式**: 支持全分辨率和半分辨率显示模式。
21-
- 🖥️ **多种终端协议支持**: 支持 WezTerm、Kitty 和 iTerm2 图片协议。
21+
- 🖥️ **多种终端协议支持**: 支持 WezTerm、Kitty、iTerm2Sixel 图片协议。
2222
- 🎞️ **GIF 动画支持**: 支持在终端中播放 GIF 动画。
2323
- 🎥 **视频播放支持**: 支持在终端中播放视频文件(需要启用 `video` 特性及 FFmpeg)。
2424
- 🔊 **音频支持**: 支持为 GIF 动画添加音频轨道。
@@ -32,11 +32,12 @@
3232

3333
## 特性说明
3434

35-
| 特性 | 依赖 | 描述 | 是否默认启用 |
36-
|--------------|-----------------------------------------------------------|--------------|-------------------------------------|
37-
| reqwest | reqwest | HTTP 请求库 | <span style="color: green">✓</span> |
38-
| gif_player | gif, rodio, crossbeam-channel | 在终端播放 GIF 动画 | <span style="color: green">✓</span> |
39-
| video_player | rodio, ez-ffmpeg, video-rs, crossbeam-channel, **FFmpeg** | 在终端播放视频 | <span style="color: red">✗</span> |
35+
| 特性 | 依赖 | 描述 | 是否默认启用 |
36+
|--------------|-----------------------------------------------------------|----------------------------------|-------------------------------------|
37+
| reqwest | reqwest | HTTP 请求库 | <span style="color: green">✓</span> |
38+
| gif_player | gif, rodio, crossbeam-channel | 在终端播放 GIF 动画 | <span style="color: green">✓</span> |
39+
| video_player | rodio, ez-ffmpeg, video-rs, crossbeam-channel, **FFmpeg** | 在终端播放视频 | <span style="color: red">✗</span> |
40+
| sixel_support| quantette, nohash-hasher | 使用 Sixel 协议显示图像 | <span style="color: green">✓</span> |
4041

4142
## 安装
4243

@@ -143,6 +144,12 @@ image_to_console --protocol kitty file image.jpg
143144

144145
# 使用 iTerm2 图片协议显示图片
145146
image_to_console --protocol iterm2 file image.jpg
147+
148+
# 使用 Sixel 协议显示图片
149+
image_to_console --protocol sixel file image.jpg
150+
151+
# 使用 Sixel 协议显示图片并设置最大颜色数
152+
image_to_console --protocol sixel --max-colors 128 file image.jpg
146153
```
147154

148155
### 文件子命令选项
@@ -207,6 +214,8 @@ image_to_console video --audio path/to/audio.mp3 path/to/video.mp4
207214
- **WezTerm 模式**(--protocol wezterm):使用 WezTerm 的内联图片协议直接显示原图
208215
- **Kitty 模式**(--protocol kitty):使用 Kitty 的内联图片协议直接显示原图
209216
- **iTerm2 模式** (--protocol iterm2) :使用 iTerm2 的内联图片协议直接显示原图
217+
- **Sixel 模式** (--protocol sixel) :使用 Sixel 协议在支持的终端中显示图像
218+
- **全分辨率 Sixel 模式** (--protocol sixel --full-resolution) :使用 Sixel 协议在支持的终端中显示图像,并使用全分辨率显示图片
210219

211220
### 灰度模式
212221

@@ -247,6 +256,8 @@ image_to_console video --audio path/to/audio.mp3 path/to/video.mp4
247256
| [ez-ffmpeg](https://crates.io/crates/ez-ffmpeg) | 0.5.3 | MIT | 视频处理(可选) |
248257
| [video-rs](https://crates.io/crates/video-rs) | 0.10.3 | MIT | 视频处理(可选) |
249258
| [ndarray](https://crates.io/crates/ndarray) | 0.16.1 | MIT | N维数组(可选) |
259+
| [quantette](https://crates.io/crates/quantette) | 0.3.0 | MIT | Sixel 图像量化(可选) |
260+
| [nohash-hasher](https://crates.io/crates/nohash-hasher) | 0.2.0 | MIT | Sixel 快速哈希(可选) |
250261

251262
## License
252263

0 commit comments

Comments
 (0)