~xigoi/vier

59b85b9f441b5580f93c11188d030c33342af399 — Adam Blažek 8 months ago 6490535
Clarified documentation
2 files changed, 9 insertions(+), 5 deletions(-)

M website/index.html
M website/index.xd
M website/index.html => website/index.html +4 -3
@@ 15,7 15,8 @@
<pre class="language-sh"><code class="language-sh"><span class="token function">git</span> clone https://git.sr.ht/~xigoi/vier
nimble <span class="token function">install</span>
</code></pre>
<p>Note that you need to have <code>$HOME/.nimble/bin</code> in your <code>$PATH</code>.</p></section>
<p>Note that you need to have <code>$HOME/.nimble/bin</code> in your <code>$PATH</code>.</p>
<p>Also note that since Nimble does not support optional dependencies, it will download transitive dependencies that are not actually needed for the project. I am looking into ways to solve this issue.</p></section>
<section><h2 class="xd-section-heading">Usage</h2><p>Launch Vier via the command line on the picture(s) you want to edit:</p>
<pre class="language-sh"><code class="language-sh">vier cat.png dog.png
</code></pre>


@@ 24,7 25,7 @@ nimble <span class="token function">install</span>
</code></pre></section>
<section><h2 class="xd-section-heading">Modes and Tools</h2>In most graphics editing programs, there is the concept of a <dfn>tool</dfn>, a state of the editor which determines what action is performed when clicking on an image. This is also the case for Vier, but like in Vim, there is also the concept of <dfn>modes</dfn> – a state which affects more generally how keys are interpreted.
<p>Vier has these modes:</p>
<dl><dt><img src="assets/icons/modes/inject.png" alt="Inject mode icon" /> Inject mode</dt><dd>In this mode, the user can move around the selected picture using <kbd>H</kbd><kbd>J</kbd><kbd>K</kbd><kbd>L</kbd> keys and draw with the currently selected tool. The color of the pixels being drawn is replaced by the selected color, so this can also work as an “eraser” if the selected color is transparent. If multiple pictures are opened, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/add.png" alt="Add mode icon" /> Add mode</dt><dd>In this mode, the user can move around the selected picture using <kbd>H</kbd><kbd>J</kbd><kbd>K</kbd><kbd>L</kbd> keys and draw with the currently selected tool. The selected color is added on the color of the pixels being drawn, which allows shading an area with a transparent color. If multiple pictures are opened, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/select.png" alt="Select mode icon" /> Select mode</dt><dd>In this mode, the user can move around the selected picture using <kbd>H</kbd><kbd>J</kbd><kbd>K</kbd><kbd>L</kbd> keys and select a part of the picture using the currently selected tool. If multiple pictures are opened, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/color.png" alt="Color mode icon" /> Color mode</dt><dd>In this mode, the user can move around a color palette (displayed at the top of the screen) to change the selected color (displayed in the upper left corner). If multiple palettes are available, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/command.png" alt="Command mode icon" /> Command mode</dt><dd>In this mode, the user can enter a command, displayed at the bottom of the screen, to perform complex actions such as opening a file. The commands are in the <a href="https://sprylang.se/">Spry</a> programming language, though this is not important for basic usage. The command is executed by pressing <kbd>⏎</kbd> or cancelled by pressing <kbd>Esc</kbd>.</dd></dl>
<dl><dt><img src="assets/icons/modes/inject.png" alt="Inject mode icon" /> Inject mode</dt><dd>In this mode, the user can move around the selected picture using <kbd>H</kbd><kbd>J</kbd><kbd>K</kbd><kbd>L</kbd> keys and draw with the currently selected tool. The color of the pixels being drawn is replaced by the selected color, so this can also work as an “eraser” if the selected color is transparent. If multiple pictures are opened, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/add.png" alt="Add mode icon" /> Add mode</dt><dd>In this mode, the user can move around the selected picture using <kbd>H</kbd><kbd>J</kbd><kbd>K</kbd><kbd>L</kbd> keys and draw with the currently selected tool. The selected color is added on the color of the pixels being drawn, which allows shading an area with a transparent color. If multiple pictures are opened, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/select.png" alt="Select mode icon" /> Select mode</dt><dd>In this mode, the user can move around the selected picture using <kbd>H</kbd><kbd>J</kbd><kbd>K</kbd><kbd>L</kbd> keys and select a part of the picture using the currently selected tool. The selection is currently useless; copy-paste functionality will be implemented later. If multiple pictures are opened, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/color.png" alt="Color mode icon" /> Color mode</dt><dd>In this mode, the user can move around a color palette (displayed at the top of the screen) to change the selected color (displayed in the upper left corner). If multiple palettes are available, they can be switched between using <kbd>Ctrl</kbd>-<kbd>H</kbd> and <kbd>Ctrl</kbd>-<kbd>L</kbd>.</dd><dt><img src="assets/icons/modes/command.png" alt="Command mode icon" /> Command mode</dt><dd>In this mode, the user can enter a command, displayed at the bottom of the screen, to perform complex actions such as opening a file. The commands are in the <a href="https://sprylang.se/">Spry</a> programming language, though this is not important for basic usage. The command is executed by pressing <kbd>⏎</kbd> or cancelled by pressing <kbd>Esc</kbd>.</dd></dl>
<p>The following tools are available:</p>
<dl><dt><img src="assets/icons/tools/brush.png" alt="Brush icon" /> Brush</dt><dd>The brush tool selects pixels that it moves over.</dd><dt><img src="assets/icons/tools/segment.png" alt="Segment icon" /> Segment</dt><dd>The segment tool selects a line segment.</dd><dt><img src="assets/icons/tools/rectangle.png" alt="Rectangle icon" /> Rectangle</dt><dd>The rectangle tool selects an axis-aligned rectangle.</dd><dt><img src="assets/icons/tools/flood.png" alt="Flood icon" /> Flood</dt><dd>The flood tool selects a contiguous area of pixels with the same color.</dd></dl></section>
<section><h2 class="xd-section-heading">Keyboard mappings</h2><p>The key mappings are inspired by Vim. They are currently not customizable.</p>


@@ 53,6 54,6 @@ Note that the mouse can also be used to draw and select colors. The right mouse 
<section><h2 class="xd-section-heading">Commands</h2><dl><dt><code>e image.png</code></dt><dd>open a file for editing (the filename is a symbol)</dd><dt><code>edit &quot;image.png&quot;</code></dt><dd>open a file for editing (the filename is a string)</dd><dt><code>flip-x</code></dt><dd>flip the current picture horizontally</dd><dt><code>flip-y</code></dt><dd>flip the current picture vertically</dd><dt><code>new</code></dt><dd>create a new picture with a transparent background and the default size</dd><dt><code>resize-nn 16 8</code></dt><dd>resize the current picture using the nearest-neighbor algorithm</dd><dt><code>w image.png</code></dt><dd>save the current picture under the specified filename (the filename is a symbol)</dd><dt><code>write &quot;image.png&quot;</code></dt><dd>save the current picture under the specified filename (the filename is a string)</dd></dl>
<p>Note that currently, edits done via commands are not added to undo history and break it.</p></section>
<section><h2 class="xd-section-heading">Planned features</h2><p>Roughly in order of priority.</p>
<ul><li>upscaling (various algorithms)</li><li>ellipse tool</li><li>eyedropper tool</li><li>mirrored drawing</li><li>color picker, palette editing</li><li>programmable configuration</li><li>gradients</li><li>animated sprite editing</li></ul></section>
<ul><li>copy/paste functionality for the select mode</li><li>ellipse tool</li><li>eyedropper tool</li><li>upscaling (various algorithms)</li><li>better editing support and tab completion for the command line</li><li>mirrored drawing</li><li>color picker, palette editing</li><li>programmable configuration</li><li>gradients</li><li>animated sprite editing</li></ul></section>
<section><h2 class="xd-section-heading">Name</h2><p>I partially created Vier as a semestral project for a Computer Graphics course at my university. The name of the lecturer can be loosely translated as “fear”, so I decided to name the project after a German word which is pronounced the same way. The word means “four”, which hints at the editor treating images as a square grid (with squares having four sides, obviously). I also came up with the backronym “Vim-Inspired Editor of Rasters”.</p></section>
</body></html>
\ No newline at end of file

M website/index.xd => website/index.xd +5 -2
@@ 25,6 25,7 @@
    nimble install
  ]]
  [p Note that you need to have [code $HOME/.nimble/bin] in your [code $PATH].]
  [p Also note that since Nimble does not support optional dependencies, it will download transitive dependencies that are not actually needed for the project. I am looking into ways to solve this issue.]
]
[section Usage;
  [p Launch Vier via the command line on the picture(s) you want to edit:]


@@ 42,7 43,7 @@
  [description-list
    ; [link-image Inject mode icon; assets/icons/modes/inject.png] Inject mode; In this mode, the user can move around the selected picture using [<kbd> H][<kbd> J][<kbd> K][<kbd> L] keys and draw with the currently selected tool. The color of the pixels being drawn is replaced by the selected color, so this can also work as an [" eraser] if the selected color is transparent. If multiple pictures are opened, they can be switched between using [<kbd> Ctrl]-[<kbd> H] and [<kbd> Ctrl]-[<kbd> L].
    ; [link-image Add mode icon; assets/icons/modes/add.png] Add mode; In this mode, the user can move around the selected picture using [<kbd> H][<kbd> J][<kbd> K][<kbd> L] keys and draw with the currently selected tool. The selected color is added on the color of the pixels being drawn, which allows shading an area with a transparent color. If multiple pictures are opened, they can be switched between using [<kbd> Ctrl]-[<kbd> H] and [<kbd> Ctrl]-[<kbd> L].
    ; [link-image Select mode icon; assets/icons/modes/select.png] Select mode; In this mode, the user can move around the selected picture using [<kbd> H][<kbd> J][<kbd> K][<kbd> L] keys and select a part of the picture using the currently selected tool. If multiple pictures are opened, they can be switched between using [<kbd> Ctrl]-[<kbd> H] and [<kbd> Ctrl]-[<kbd> L].
    ; [link-image Select mode icon; assets/icons/modes/select.png] Select mode; In this mode, the user can move around the selected picture using [<kbd> H][<kbd> J][<kbd> K][<kbd> L] keys and select a part of the picture using the currently selected tool. The selection is currently useless[;] copy-paste functionality will be implemented later. If multiple pictures are opened, they can be switched between using [<kbd> Ctrl]-[<kbd> H] and [<kbd> Ctrl]-[<kbd> L].
    ; [link-image Color mode icon; assets/icons/modes/color.png] Color mode; In this mode, the user can move around a color palette (displayed at the top of the screen) to change the selected color (displayed in the upper left corner). If multiple palettes are available, they can be switched between using [<kbd> Ctrl]-[<kbd> H] and [<kbd> Ctrl]-[<kbd> L].
    ; [link-image Command mode icon; assets/icons/modes/command.png] Command mode; In this mode, the user can enter a command, displayed at the bottom of the screen, to perform complex actions such as opening a file. The commands are in the [link Spry; https://sprylang.se/] programming language, though this is not important for basic usage. The command is executed by pressing [<kbd> ⏎] or cancelled by pressing [<kbd> Esc].
  ]


@@ 98,9 99,11 @@
[section Planned features;
  [p Roughly in order of priority.]
  [list
    ; upscaling (various algorithms)
    ; copy/paste functionality for the select mode
    ; ellipse tool
    ; eyedropper tool
    ; upscaling (various algorithms)
    ; better editing support and tab completion for the command line
    ; mirrored drawing
    ; color picker, palette editing
    ; programmable configuration