fivebythree.net

w3mimgdisplayの使い方

2022-09-24
Abstract
w3mimagedisplayの使い方

w3mimgdisplay はコマンドラインから使えないこともない

Linuxのフレームバッファに画像を出力するユーティリティにw3mimgdisplayがあります。 コンソールで作業しているときに画像を確認したりするのに使えなくもないです。

もともと w3m 上で画像を表示するユーティリティなので、コマンドラインから便利に使うようにはできていませんが。

ソフトを起動したら標準入力にコマンドを打ち込んでいくタイプです。

使い方

(w3m w3m-img がインストールされていることを前提に・・・)

書式

The w3mimg protocol is documented in the source files like this:

0 1 2 ....
+--+--+--+--+ ...... +--+--+
|op|; |args |\n|
+--+--+--+--+ .......+--+--+

args is separeted by ';'
op args
0; params draw image
1; params redraw image
2; -none- terminate drawing
3; -none- sync drawing
4; -none- nop, sync communication
response '\n'
5; path get size of image,
response "<width> <height>\n"
6; params(6) clear image

params
<n>;<x>;<y>;<w>;<h>;<sx>;<sy>;<sw>;<sh>;<path>
params(6)
<x>;<y>;<w>;<h>

画像のサイズ

echo '5;./file.jpg' | /usr/lib/w3m/w3mimgdisplay
```

```
640 517
```

### 画像の表示

```
echo '0;1;0;0;640;517;;;;;./file.jpg' | /usr/lib/w3m/w3mimgdisplay 
```

## References

[w3mimgdisplay use?](https://mutt-users.mutt.narkive.com/67TlThAD/w3mimgdisplay-use)