@@ -51,39 +51,110 @@ pip install -r requirements.txt
5151Usage: demo.py [OPTIONS] IMG_PATH
5252
5353Options:
54- --range TEXT Range to rotate through
55- --stream / --no-stream Stream output in raw format (for use with pipes).
56- Implies --animate
57- --display / --no-display Display output with chafa
58- --view / --no-view View a file with chafa (don' t generate anything)
59- --output-dir TEXT Output directory for frames
60- --output-file TEXT Output file for animated gif
61- --img-shape TEXT Ideal image shape in WxH format (optional)
62- --help Show this message and exit.
54+ --bg TEXT Background color to pass to chafa
55+ --display Display output with chafa
56+ --invert Pass --invert to chafa
57+ --img-shape TEXT Ideal image shape in WxH format (optional)
58+ --duration TEXT Duration argument to pass to chafa
59+ --output-dir TEXT Output directory for frames
60+ --output-file TEXT Output file for animated gif
61+ --range TEXT Range to rotate through
62+ --stream / --no-stream Stream output in raw format (for use with pipes).
63+ Implies --animate
64+ --verbose Whether or not ffmpeg-stderr is displayed
65+ --view View a file with chafa (generates nothing)
66+ --rotation TEXT One of { x | y | yz }
67+ --speed TEXT Speed factor to pass to ffmpeg (default=.08)
68+ --stretch Whether to pass --stretch to chafa
69+ --help Show this message and exit.
6370
6471` ` `
6572
73+ You can also set ` LOGLEVEL=debug` for more info.
74+
6675-------------------------------------
6776
6877# # Usage from Docker
6978
70- **A few examples of usage from docker:**
79+ A few examples of usage from docker:
80+
81+ ** Saving an animated gif to a file:**
7182
7283` ` ` bash
73- # Saves the animated gif to a file.
7484$ docker run -it --rm -v ` pwd` :/workspace -w /workspace robotwranglers/imgrot img/icon.png --range 360 --img-shape 200x200 --stream > demo.gif
7585` ` `
7686
7787< p align=center>
7888< img width=25% align=center src=img/demo.gif>
7989< /p>
8090
91+ ** Rendering a gif, then displaying it in a terminal-friendly way with chafa:**
92+
8193` ` ` bash
82- # Renders a gif from a static image, then displays it in a terminal-friendly way with chafa
83- $ docker run -it --rm -v `pwd`:/workspace -w /workspace robotwranglers/imgrot img/icon.png --range 360 --img-shape 200x200 --display
94+ $ docker run -it --rm -v ` pwd` :/workspace -w /workspace robotwranglers/imgrot img/icon.png --display --stretch --bg lightblue
8495` ` `
8596
8697< p align=center>
8798< img width=50% align=center src=img/demo.chafa.gif>
8899< /p>
89100
101+ Note that this tries to respect transparency in the original image, but for more contrast you can effectively add highlights by passing ' --bg' arguments that go through to chafa.
102+
103+ ------------------------------
104+
105+ ** Changing axis of rotation**
106+
107+ The rotation can be controlled to create a bunch of different effects:
108+
109+ ` ` ` bash
110+ $ docker run -it --rm -v ` pwd` :/workspace \
111+ -w /workspace robotwranglers/imgrot \
112+ img/icon.png \
113+ --display --stretch \
114+ --bg darkgreen \
115+ --rotation < some-rotation here>
116+ ` ` `
117+
118+ < p align=center>
119+ < table>
120+ < tr>
121+ < th> x< /th>
122+ < th> y< /th>
123+ < th> s,swivel< /th>
124+ < /tr>
125+ < tr>
126+ < td>
127+ < img src=img/rx.gif></td>
128+ < td>
129+ < img src=img/ry.gif>
130+ < /td>
131+ < td><img src=img/rs.gif></td>
132+ < /tr>
133+ < tr>
134+ < th> j,jitter< /th>
135+ < th> w,wobble< /th>
136+ < th> f,flip< /th>
137+ < /tr>
138+ < tr>
139+ < td>
140+ < img src=img/rj.gif></td>
141+ < td>
142+ < img src=img/rw.gif>
143+ < /td>
144+ < td><img src=img/rf.gif></td>
145+ < /tr>
146+ < tr>
147+ < th> exit-ul< /th>
148+ < th> exit-ur< /th>
149+ < th> exit-lr< /th>
150+ < /tr>
151+ < tr>
152+ < td>
153+ < img src=img/rul.gif></td>
154+ < td>
155+ < img src=img/rur.gif>
156+ < /td>
157+ < td><img src=img/rlr.gif></td>
158+ < /tr>
159+ < /table>
160+ < /p>
0 commit comments