textual-paint


Nametextual-paint JSON
Version 0.4.0 PyPI version JSON
download
home_pagehttps://github.com/1j01/textual-paint
SummaryMS Paint in the terminal, built with Textual
upload_time2024-01-11 22:49:11
maintainer
docs_urlNone
authorIsaiah Odhner
requires_python
licenseMIT
keywords tui terminal paint drawing art graphics text textual rich ansi ansi-art mspaint
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            
Textual Paint
=============

MS Paint in your terminal.

This is a TUI (Text User Interface) image editor, inspired by MS Paint, built with [Textual](https://textual.textualize.io/).

![MS Paint like interface](https://raw.githubusercontent.com/1j01/textual-paint/v0.1.0/screenshot.svg)

## Features

- [x] Open and save images
  - [x] Fancy file dialogs
  - [x] Drag and drop files to open
  - [x] Warnings when overwriting an existing file, or closing with unsaved changes
  - [x] Auto-saves a temporary `.ans~` backup file alongside the file you're editing, for crash recovery
  - [x] Edits ANSI art and raster images and more. See [File Formats](#file-formats)
- [x] All tools from MS Paint: Free-Form Select, Select, Eraser/Color Eraser, Fill With Color, Pick Color, Magnifier, Pencil, Brush, Airbrush, Text, Line, Curve, Rectangle, Polygon, Ellipse, and Rounded Rectangle
- [x] Color palette
- [x] Efficient screen updates and undo/redo history, by tracking regions affected by each action
- [x] You should be able to use this over SSH
- [x] Brush previews
- [x] Status bar
- [x] Menu bar
- [x] Keyboard shortcuts
- [x] Nearly every command from MS Paint is supported, including fun ones like:
  - [x] Flip/Rotate
  - [x] Stretch/Skew
  - [x] Edit Colors
  - [x] Set As Wallpaper (Tiled/Centered)
- [x] Localization into 26 languages: Arabic, Czech, Danish, German, Greek, English, Spanish, Finnish, French, Hebrew, Hungarian, Italian, Japanese, Korean, Dutch, Norwegian, Polish, Portuguese, Brazilian Portuguese, Russian, Slovak, Slovenian, Swedish, Turkish, Chinese, Simplified Chinese
- [x] Dark mode
- [x] Zooming works with text, despite running in the terminal :)

## Usage

Python 3.10 or later is required. See [Compatibility](#compatibility) for details on terminals supported.

### Installation

Use `pipx` to install globally, without installing dependencies globally:
```bash
pip install --upgrade pipx  # or in Arch Linux, sudo pacman -S python-pipx
pipx install textual-paint
```

Alternatively, you can install using `pip`:
```bash
pip install textual-paint
```

### Running

```bash
textual-paint
```

### Command Line Options

```
$ textual-paint --help
usage: textual-paint [options] [filename]

Paint in the terminal.

positional arguments:
  filename              Path to a file to open. File will be created if it
                        doesn't exist.

options:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  --theme {light,dark}  Theme to use, either "light" or "dark"
  --language {ar,cs,da,de,el,en,es,fi,fr,he,hu,it,ja,ko,nl,no,pl,pt,pt-br,ru,sk,sl,sv,tr,zh,zh-simplified}
                        Language to use
  --ascii-only-icons    Use only ASCII characters for tool icons, no emoji or
                        other Unicode symbols
  --ascii-only          Use only ASCII characters for the entire UI, for use in
                        older terminals. Implies --ascii-only-icons
  --backup-folder FOLDER
                        Folder to save backups to. By default a backup is saved
                        alongside the edited file.

development options:
  --inspect-layout      Enables DOM inspector (F12) and middle click highlight
  --clear-screen        Clear the screen before starting, to avoid seeing
                        outdated errors
  --restart-on-changes  Restart the app when the source code is changed
```

### Keyboard Shortcuts

- <kbd>Ctrl</kbd>+<kbd>D</kbd>: Toggle Dark Mode
- <kbd>Ctrl</kbd>+<kbd>Q</kbd>: Quit
- <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd>: Save As **IF SHIFT IS DETECTED** — ⚠️ it might trigger Save instead, and overwrite the open file!
- <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Z</kbd>: Redo **IF SHIFT IS DETECTED** — ⚠️ it might trigger Undo instead.

The rest match MS Paint's keyboard shortcuts:

- <kbd>Ctrl</kbd>+<kbd>S</kbd>: Save
- <kbd>Ctrl</kbd>+<kbd>O</kbd>: Open
- <kbd>Ctrl</kbd>+<kbd>N</kbd>: New
- <kbd>Ctrl</kbd>+<kbd>T</kbd>: Toggle Tools Box
- <kbd>Ctrl</kbd>+<kbd>W</kbd>: Toggle Colors Box
- <kbd>Ctrl</kbd>+<kbd>Z</kbd>: Undo
- <kbd>Ctrl</kbd>+<kbd>Y</kbd>: Redo
- <kbd>F4</kbd>: Redo
- <kbd>Ctrl</kbd>+<kbd>A</kbd>: Select All
- <kbd>Delete</kbd>: Clear Selection
- <kbd>Ctrl</kbd>+<kbd>C</kbd>: Copy
- <kbd>Ctrl</kbd>+<kbd>V</kbd>: Paste
- <kbd>Ctrl</kbd>+<kbd>X</kbd>: Cut
- <kbd>Ctrl</kbd>+<kbd>E</kbd>: Image Attributes
- <kbd>Ctrl</kbd>+<kbd>PageUp</kbd>: Large Size
- <kbd>Ctrl</kbd>+<kbd>PageDown</kbd>: Normal Size

### File Formats

<!-- PyPI doesn't generate linkable headings -->
<a id="file-formats"></a>

Many file formats are supported, including ANSI art, raster images, SVG and HTML.

To choose a file format when saving, type its file extension. For example, to save a PNG, add `.png` to the end of the filename. The default is `.ans`.

| Format | Notes |
| --- | --- |
| **ANSI** (.ans) | Note that while it handles many more ANSI control codes when loading than those that it uses to save files, you may have limited success loading other ANSI files that you find on the web, or create with other tools. ANSI files can vary a lot and even encode animations! |
| **mIRC codes** (.irc, .mirc) | invented file extensions, and not to be confused with .mrc mIRC script files |
| **Plain Text** (.txt) | |
| **SVG** (.svg) | can open SVGs saved by Textual Paint, which embed ANSI data; can also open some other SVGs that consist of a grid of rectangles and text elements. For fun, as a challenge, I made it quite flexible; it can handle uneven grids of unsorted rectangles. But that's only used as a fallback, because it's not perfect. |
| **HTML** (.htm, html) | write-only (opening not supported) |
| **PNG** (.png) | opens first frame of an APNG file |
| **Bitmap** (.bmp) | |
| **GIF** (.gif) | opens first frame |
| **TIFF** (.tiff) | opens first frame |
| **WebP** (.webp) | opens first frame |
| **JPEG** (.jpg, .jpeg) | saving disabled because it's lossy (it would destroy your pixel art) |
| **Windows Icon** (.ico) | opens largest size in the file |
| **Mac OS Icon** (.icns) | opens largest size in the file; saving disabled because it requires specific sizes |
| **Windows Cursor** (.cur) | opens largest size in the file; saving not supported by Pillow (and it would need a defined hot spot) |

See [Pillow's documentation](https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html) for more supported formats.

Note that metadata is not preserved when opening and saving image files. This is however common for many image editors.

### Tips

You can draw with a character by clicking the selected color display area in the palette and then typing the character,
or by double clicking the same area to pick a character from a list.

You can set the text color by right clicking or holding <kbd>Ctrl</kbd> while clicking a color in the palette.
Also, if you double right click or hold <kbd>Ctrl</kbd> while double clicking on a color to open the Edit Colors dialog,
if will edit the text color when you click OK.

You can swap the foreground and background colors by right clicking or holding <kbd>Ctrl</kbd> while clicking the current colors area.
This is a great convenience, especially when using the Color Eraser tool, or when using custom colors that may be hard to distinguish.

You can display a saved ANSI file in the terminal with `cat`:

```bash
cat samples/ship.ans
```

To browse the sample art, run:

```bash
python -m src.textual_paint.gallery
```

To preview ANSI art files in file managers like Nautilus, Thunar, Nemo, or Caja, you can install the [ansi-art-thumbnailer](https://github.com/1j01/ansi-art-thumbnailer) program I made to go along with this project.


## Known Issues

- Undo/Redo doesn't work inside the Text tool's textbox. <kbd>Ctrl</kbd>+<kbd>Z</kbd> will delete the textbox. (Also note that the Text tool works differently from MS Paint; it will overwrite characters and the cursor can move freely, which makes it better for ASCII art, but worse for prose.)
- The Text tool's cursor doesn't blink.
- The selection box border appears inside instead of outside (and lacks dashes). For the text box, I hid the border because it was too visually confusing, but it should also have an outer border.
- Pressing both mouse buttons stops the current tool, but doesn't undo the current action. Also Pick Color can't be cancelled (with <kbd>Esc</kbd> or by pressing both mouse buttons), since it samples the color continuously.
- Due to limitations of the terminal, shortcuts using <kbd>Shift</kbd> or <kbd>Alt</kbd> might not work. Menus are not keyboard navigable, because I can't detect <kbd>Alt</kbd>+<kbd>F</kbd>, etc.
- The Zoom submenu flickers as it opens, and may not always open in the right place. (Fixed?)
- The canvas flickers when zooming in with the Magnifier tool.
- Some languages don't display correctly.
- Large files can make the program very slow, as can magnifying the canvas. There is a 500 KB limit when opening files to prevent it from freezing.
- The status bar description can be left blank when selecting a menu item. (I think the `Leave` event can come after closing, once the mouse moves.)
- Menu items like Copy/Cut/Paste are not grayed out when inapplicable. Only unimplemented items are grayed out.
- ANSI files (.ans) are treated as UTF-8 when saving and loading, rather than CP437 or Windows-1252 or any other encodings. Unicode is nice and modern terminals support it, but it's not the standard for ANSI files. There isn't really a standard for ANSI files.
- ANSI files are loaded with a white background. This may make sense as a default for text files, but ANSI files either draw a background or assume a black background, being designed for terminals.
- Hitting Enter in View Bitmap mode may trigger a menu item while exiting the mode. Menu items ought to be disabled when hidden, and View Bitmap should also prevent the key event from taking other actions if possible.
- Airbrush is continuous in space instead of time. It should keep spraying while the mouse stays still.
- Error messages may not show up when opening a file fails. I'm not sure how to reproduce this, so if you run into this, do let me know.
- Edit Colors dialog
  - Focus ring shows even while grid is not focused
  - Can show two cells as selected, instead of one across both grids
  - Custom colors order X/Y is different from MS Paint
  - Pressing enter in color grid should select color and close
  - Selection ring is hard to see in dark mode
  - Focus ring is invisible on a black color cell
  - When dragging on the color field or luminosity slider, the cursor can be seen to jump back to earlier places where the mouse was, before settling at the current position. (This may only be visible when the program is running slowly, such while debugging. I haven't observed this on the canvas, so maybe it has something to do with the dialog being on a separate layer.)
  - When opening the Edit Colors dialog, it may immediately close, if the mouse lines up with the "OK" or "Cancel" buttons. (This doesn't seem to currently happen, but I haven't knowingly fixed it. A git bisect turned up a bogus commit, possibly due to reproducing the behavior being unreliable. It also seems like it might depend on the specific layout of the dialog, which changed during development, and maybe even the terminal size.)

## Compatibility

<!-- PyPI doesn't generate linkable headings -->
<a id="compatibility"></a>

Python 3.10 or later is required.

### Linux

Tested on Ubuntu 22, with GNOME Terminal, Kitty, XTerm, and VS Code's integrated terminal.

GNOME Terminal works best, with crisp triangles used for icons in dialogs, emoji support, and true color support.

Kitty works fine, supporting true color and emoji.

XTerm supports true color, but not emoji. Run with `COLORTERM=truecolor textual-paint --ascii-only` for XTerm compatibility.

### macOS

Tested on OSX 10.14 (Mojave), with iTerm2, and VS Code's integrated terminal.

In VS Code, Free-Form Select shows as tofu (a missing character symbol).

The default Terminal has missing characters, causing misalignment of everything to the right of them, plus borders are not rendered nicely, giving it a sort of *frayed fabric* look, and it's limited to 256 colors.

### Windows

Textual Paint works with the new [Windows Terminal](https://learn.microsoft.com/windows/terminal/install).

#### Pasting in Windows Terminal

[<kbd>Ctrl</kbd>+<kbd>V</kbd> does not work](https://github.com/microsoft/terminal/issues/11267) to paste by default, but **Edit > Paste** does work.
You can unbind <kbd>Ctrl</kbd>+<kbd>V</kbd> to fix this:
- Open Windows Terminal's Settings (<kbd>Ctrl</kbd>+<kbd>,</kbd>)
- Click "Open JSON file"
- Disable the paste binding by adding `//` to the beginning of the lines:
  ```json
  // {
  //     "command": "paste",
  //     "keys": "ctrl+v"
  // },
  ```
- Save the file, and the behavior should update immediately.

Alternatively, you can use the Actions tab of the Settings UI to remove the binding for <kbd>Ctrl</kbd>+<kbd>V</kbd>.

If you're wondering why *removing* the Paste binding fixes it, it's because Textual Paint needs to receive the literal <kbd>Ctrl</kbd>+<kbd>V</kbd> key presses in order to trigger its own Paste command.

#### Powershell Problems

Running in Powershell, you may run into a bug where the powershell prompt becomes active at the same time as the TUI.
Moving the mouse will redraw parts of the TUI, and it becomes hard to click on things, but still possible.
Commands can be entered, and the output will be interwoven with the TUI, including if you run a second instance of the program, in which case the two instances will vie for the screen.
If this happens, I would recommend first messing around with it, since it's a fun glitch, then opening a new tab in Windows Terminal with the **Command Prompt profile**, available in the new tab dropdown menu.

#### Windows Console

Textual Paint will **not** work properly with the old Windows console (`conhost.exe`), which lacks emoji/Unicode support and true color support.
This program is commonly thought of as the "Command Prompt", but the Command Prompt (`cmd.exe`) is actually a *shell* (like `bash`) that can run in either the old console or the new Windows Terminal, which are both *terminal emulators*.

You can run with `--ascii-only` to limit the characters used in the UI to ASCII, but colors will still be limited and similar colors will appear confusingly identical.

### VS Code

Note that VS Code's integrated terminal tries to fix the contrast of text, including in the canvas, which is entirely inappropriate for an ANSI art editor, as it obscures the colors, and can indeed *harm* the contrast of the resulting document, by tricking you into thinking there's more contrast than there actually is.

To disable this, you can add this to your settings.json:

```json
"terminal.integrated.minimumContrastRatio": 1
```

If this doesn't work, try increasing it to 1.1.


## Development

First, create a virtual environment, and activate it:
```bash
python -m venv .venv
# The activate script is in different places on different systems:
# Linux/macOS:
source .venv/bin/activate
# Windows:
.venv\Scripts\activate
```

Install Textual and other dependencies:
```bash
pip install -r requirements.txt
```

Run the app via Textual's CLI for live-reloading CSS support, and enable other development features:
```bash
textual run --dev "src.textual_paint.paint --clear-screen --inspect-layout --restart-on-changes"
```

Or run more basically:
```bash
python -m src.textual_paint.paint
```

Or install the CLI globally\*:
```bash
pip install --editable .
```

Then run:
```bash
textual-paint
```

\*If you use a virtual environment, it will only install within that environment.

`--clear-screen` is useful for development, because it's sometimes jarring or perplexing to see error messages that have actually been fixed, when exiting the program.

`--inspect-layout` enables a DOM inspector accessible with F12, which I built. It also lets you apply a rainbow highlight and labels to all ancestors under the mouse with middle click, but this is mostly obsolete/redundant with the DOM inspector now. The labels affect the layout, so you can also hold Ctrl to only colorize, and you can remember how the colors correspond to the labels, to build a mental model of the layout.

`--restart-on-changes` automatically restarts the program when any Python files change. This works by the program restarting itself directly. (Programs like `modd` or `nodemon` that run your program in a subprocess don't work well with a TUI's escape sequences.)

There are also launch tasks configured for VS Code, so you can run the program from the Run and Debug panel.
Note that it runs slower in VS Code's debugger.

To see logs, run [`textual console`](https://textual.textualize.io/guide/devtools/#console) and then run the program via `textual run --dev`.
This also makes it run slower.

Often it's useful to exclude events with `textual console -x EVENT`.

### Troubleshooting

> `Unable to import 'app' from module 'src.textual_paint.paint'`

- Make sure to activate the virtual environment, if you're using one.
- Make sure to run the program from the root directory of the repository.

> `ModuleNotFoundError: No module named 'src'`

- Make sure to run the program from the root directory of the repository.

### Quality Assurance

```bash
# Spell checking
# I use the VS Code extension "Code Spell Checker", and its associated CLI:
cspell-cli lint .

# Type checking
# I use the "Python" and "Pylance" VS Code extensions, and the Pyright CLI:
pyright
# I'm targeting zero errors at this version of Pyright:
PYRIGHT_PYTHON_FORCE_VERSION=1.1.345 pyright
# I also tried mypy and fixed some errors it reported, but I'm not targeting zero errors with mypy.
mypy src --no-namespace-packages --check-untyped-defs

# Visual Regression Testing (and a few other tests)
# I use pytest-textual-snapshot, which is a pytest plugin for comparing SVG screenshots of Textual apps over time.
pytest
# To accept differences, update the baseline with:
pytest --snapshot-update
# I also made a test recorder, which can generate test code, which is great for creating tests that interact with the canvas.
# Run with:
python tests/pilot_recorder.py
# Then interact with the app, and press Ctrl+C to stop recording.
# You can also hit Ctrl+R to replay what you have,
# or Ctrl+Z to remove the last step and replay the rest.
```

### Publishing

- Run QA steps above
- Update version numbers in `setup.cfg` and `src/textual_paint/__init__.py` to a pre-release version (e.g. `0.3.0-pre.1`)
- Add version header to `CHANGELOG.md` below "Unreleased", and update version links at bottom
- Commit (e.g. `git commit -m "Prepare v0.3.0"`)
- Build package: `python -m build --sdist --wheel`
- Upload to TestPyPI: (updating version numbers) `python -m twine upload --repository testpypi dist/textual_paint-0.3.0rc1-py3-none-any.whl dist/textual_paint-0.3.0rc1.tar.gz`
- Test installing from TestPyPI with: (outside the venv, updating the version number) `pipx uninstall textual-paint; pipx install textual-paint==0.3.0rc1 --pip-args "--index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple textual-paint"`
- If all is good, update version numbers to remove `-pre.N` suffixes
- Amend commit (`git commit --amend --no-edit`)
- Rebuild: `python -m build --sdist --wheel`
- Upload to PyPI: `python -m twine upload dist/textual_paint-0.3.0-py3-none-any.whl dist/textual_paint-0.3.0.tar.gz`
- Push `main` branch (`git push origin main`)
- Tag and push tag (e.g. `git tag v0.3.0 && git push origin v0.3.0`)

## License

[MIT](https://github.com/1j01/textual-paint/blob/main/LICENSE.txt)

## News

For a history of changes to the project, see the [changelog](https://github.com/1j01/textual-paint/blob/main/CHANGELOG.md).

## Unicode Symbols and Emojis for Paint Tools

The first thing I did in this project was to collect possible characters to represent all the tool icons in MS Paint, to gauge how good of a recreation it would be possible to achieve, starting from looks.
As it turns out, I didn't run into any significant roadblocks, so I ended up recreating MS Paint. [Again.](https://jspaint.app)

These are the symbols I've found so far:

- Free-Form Select: ✂️📐🆓🕸✨☆⚝⛤⛥⛦⛧⚛🫥🇫/🇸◌⁛⁘ ⢼⠮ 📿➰➿𓍼യ🪢𓍯 𔗫 𓍲 𓍱 ౿ Ꮼ Ꮘ
- Select: ✂️⬚▧🔲 ⣏⣹ ⛶
- Eraser/Color Eraser: 🧼🧽🧹🚫👋🗑️▰▱
- Fill With Color: 🌊💦💧🩸🌈🎉🎊🪣🫗🚰⛽🍯 ꗃ﹆ ⬙﹅ 🪣﹅
- Pick Color: 🎨🌈💉💅💧🩸🎈📌📍🪛🪠🥍🩼🌡💄🎯𖡡⤤𝀃🝯⊸⚲𓋼🗡𓍊🍶🧪🍼🌂👁️‍🗨️🧿🍷⤵❣⚗ ⤆Ϸ ⟽þ ⇐ c⟾ /̥͚̥̥͚͚̊̊
- Magnifier: 🔍🔎👀🔬🔭🧐🕵️‍♂️🕵️‍♀️
- Pencil: ✏️✎✍️🖎🖊️🖋️✒️🖆📝🖍️🪶🪈🥖🥕▪
- Brush: 🖌👨‍🎨🧑‍🎨💅🧹🪮🪥🪒🪠ⵄ⑃ሐ⋔⋲ ▭⋹ 𝈸⋹ ⊏⋹ ⸦⋹ ⊂⋹ ▬▤
- Airbrush: ⛫💨дᖜ💨╔💨🧴🥤🧃🧯🧨🍾🥫💈🫠🌬️🗯☄💭༄༺☁️🌪️🌫🌀🚿 ⪧𖤘 ᗒᗣ дᖜᗕ
- Text: 📝📄📃📜AA🅰️🆎🔤🔠𝐴
- Line: 📏📉📈\⟍𝈏╲⧹\⧵∖
- Curve: ↪️🪝🌙〰️◡◠~∼≈∽∿〜〰﹋﹏≈≋~⁓
- Rectangle: ▭▬▮▯➖🟥🟧🟨🟩🟦🟪🟫⬛⬜🔲🔳⏹️◼️◻️◾◽▪️▫️
- Polygon: ▙𝗟𝙇﹄』𓊋⬣⬟🔶🔷🔸🔹🔺🔻△▲☖⛉♦️🛑📐🪁✴️
- Ellipse: ⬭⭕🔴🟠🟡🟢🔵🟣🟤⚫⚪🔘🫧🕳️🥚💫💊🛞
- Rounded Rectangle: ▢⬜⬛𓋰⌨️⏺️💳📺🧫

The default symbols used may not be the best on your particular system, so I may add some kind of configuration for this in the future.

### Cursor

A crosshair cursor could use one of `+✜✛⊹✚╋╬⁘⁛𖥔⌖⯐`, but it might be better to show the pixel under the cursor, i.e. character cell, surrounded by dashes, like this:

```
 ╻
╺█╸
 ╹
```

## See Also

- [JavE](http://jave.de/), an advanced Java-based ASCII art editor
- [Playscii](http://vectorpoem.com/playscii/), a beautiful ASCII/ANSI art editor. This is also written in Python and MIT licensed, so I might take some code from it, for converting images to ANSI, for example. Who knows, maybe I could even try to support its file format.
- [cmdpxl](https://github.com/knosmos/cmdpxl), a pixel art editor for the terminal using the keyboard
- [pypixelart](https://github.com/douglascdev/pypixelart), a pixel art editor using vim-like keybindings, inspired by cmdpxl but not terminal-based

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/1j01/textual-paint",
    "name": "textual-paint",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "tui,terminal,paint,drawing,art,graphics,text,textual,rich,ansi,ansi-art,mspaint",
    "author": "Isaiah Odhner",
    "author_email": "isaiahodhner@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/48/55/175188382d049b6f854dec7e88f0e03d3d6e5b4b85d826af5805923eca9e/textual_paint-0.4.0.tar.gz",
    "platform": null,
    "description": "\nTextual Paint\n=============\n\nMS Paint in your terminal.\n\nThis is a TUI (Text User Interface) image editor, inspired by MS Paint, built with [Textual](https://textual.textualize.io/).\n\n![MS Paint like interface](https://raw.githubusercontent.com/1j01/textual-paint/v0.1.0/screenshot.svg)\n\n## Features\n\n- [x] Open and save images\n  - [x] Fancy file dialogs\n  - [x] Drag and drop files to open\n  - [x] Warnings when overwriting an existing file, or closing with unsaved changes\n  - [x] Auto-saves a temporary `.ans~` backup file alongside the file you're editing, for crash recovery\n  - [x] Edits ANSI art and raster images and more. See [File Formats](#file-formats)\n- [x] All tools from MS Paint: Free-Form Select, Select, Eraser/Color Eraser, Fill With Color, Pick Color, Magnifier, Pencil, Brush, Airbrush, Text, Line, Curve, Rectangle, Polygon, Ellipse, and Rounded Rectangle\n- [x] Color palette\n- [x] Efficient screen updates and undo/redo history, by tracking regions affected by each action\n- [x] You should be able to use this over SSH\n- [x] Brush previews\n- [x] Status bar\n- [x] Menu bar\n- [x] Keyboard shortcuts\n- [x] Nearly every command from MS Paint is supported, including fun ones like:\n  - [x] Flip/Rotate\n  - [x] Stretch/Skew\n  - [x] Edit Colors\n  - [x] Set As Wallpaper (Tiled/Centered)\n- [x] Localization into 26 languages: Arabic, Czech, Danish, German, Greek, English, Spanish, Finnish, French, Hebrew, Hungarian, Italian, Japanese, Korean, Dutch, Norwegian, Polish, Portuguese, Brazilian Portuguese, Russian, Slovak, Slovenian, Swedish, Turkish, Chinese, Simplified Chinese\n- [x] Dark mode\n- [x] Zooming works with text, despite running in the terminal :)\n\n## Usage\n\nPython 3.10 or later is required. See [Compatibility](#compatibility) for details on terminals supported.\n\n### Installation\n\nUse `pipx` to install globally, without installing dependencies globally:\n```bash\npip install --upgrade pipx  # or in Arch Linux, sudo pacman -S python-pipx\npipx install textual-paint\n```\n\nAlternatively, you can install using `pip`:\n```bash\npip install textual-paint\n```\n\n### Running\n\n```bash\ntextual-paint\n```\n\n### Command Line Options\n\n```\n$ textual-paint --help\nusage: textual-paint [options] [filename]\n\nPaint in the terminal.\n\npositional arguments:\n  filename              Path to a file to open. File will be created if it\n                        doesn't exist.\n\noptions:\n  -h, --help            show this help message and exit\n  --version             show program's version number and exit\n  --theme {light,dark}  Theme to use, either \"light\" or \"dark\"\n  --language {ar,cs,da,de,el,en,es,fi,fr,he,hu,it,ja,ko,nl,no,pl,pt,pt-br,ru,sk,sl,sv,tr,zh,zh-simplified}\n                        Language to use\n  --ascii-only-icons    Use only ASCII characters for tool icons, no emoji or\n                        other Unicode symbols\n  --ascii-only          Use only ASCII characters for the entire UI, for use in\n                        older terminals. Implies --ascii-only-icons\n  --backup-folder FOLDER\n                        Folder to save backups to. By default a backup is saved\n                        alongside the edited file.\n\ndevelopment options:\n  --inspect-layout      Enables DOM inspector (F12) and middle click highlight\n  --clear-screen        Clear the screen before starting, to avoid seeing\n                        outdated errors\n  --restart-on-changes  Restart the app when the source code is changed\n```\n\n### Keyboard Shortcuts\n\n- <kbd>Ctrl</kbd>+<kbd>D</kbd>: Toggle Dark Mode\n- <kbd>Ctrl</kbd>+<kbd>Q</kbd>: Quit\n- <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>S</kbd>: Save As **IF SHIFT IS DETECTED** \u2014 \u26a0\ufe0f it might trigger Save instead, and overwrite the open file!\n- <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Z</kbd>: Redo **IF SHIFT IS DETECTED** \u2014 \u26a0\ufe0f it might trigger Undo instead.\n\nThe rest match MS Paint's keyboard shortcuts:\n\n- <kbd>Ctrl</kbd>+<kbd>S</kbd>: Save\n- <kbd>Ctrl</kbd>+<kbd>O</kbd>: Open\n- <kbd>Ctrl</kbd>+<kbd>N</kbd>: New\n- <kbd>Ctrl</kbd>+<kbd>T</kbd>: Toggle Tools Box\n- <kbd>Ctrl</kbd>+<kbd>W</kbd>: Toggle Colors Box\n- <kbd>Ctrl</kbd>+<kbd>Z</kbd>: Undo\n- <kbd>Ctrl</kbd>+<kbd>Y</kbd>: Redo\n- <kbd>F4</kbd>: Redo\n- <kbd>Ctrl</kbd>+<kbd>A</kbd>: Select All\n- <kbd>Delete</kbd>: Clear Selection\n- <kbd>Ctrl</kbd>+<kbd>C</kbd>: Copy\n- <kbd>Ctrl</kbd>+<kbd>V</kbd>: Paste\n- <kbd>Ctrl</kbd>+<kbd>X</kbd>: Cut\n- <kbd>Ctrl</kbd>+<kbd>E</kbd>: Image Attributes\n- <kbd>Ctrl</kbd>+<kbd>PageUp</kbd>: Large Size\n- <kbd>Ctrl</kbd>+<kbd>PageDown</kbd>: Normal Size\n\n### File Formats\n\n<!-- PyPI doesn't generate linkable headings -->\n<a id=\"file-formats\"></a>\n\nMany file formats are supported, including ANSI art, raster images, SVG and HTML.\n\nTo choose a file format when saving, type its file extension. For example, to save a PNG, add `.png` to the end of the filename. The default is `.ans`.\n\n| Format | Notes |\n| --- | --- |\n| **ANSI** (.ans) | Note that while it handles many more ANSI control codes when loading than those that it uses to save files, you may have limited success loading other ANSI files that you find on the web, or create with other tools. ANSI files can vary a lot and even encode animations! |\n| **mIRC codes** (.irc, .mirc) | invented file extensions, and not to be confused with .mrc mIRC script files |\n| **Plain Text** (.txt) | |\n| **SVG** (.svg) | can open SVGs saved by Textual Paint, which embed ANSI data; can also open some other SVGs that consist of a grid of rectangles and text elements. For fun, as a challenge, I made it quite flexible; it can handle uneven grids of unsorted rectangles. But that's only used as a fallback, because it's not perfect. |\n| **HTML** (.htm, html) | write-only (opening not supported) |\n| **PNG** (.png) | opens first frame of an APNG file |\n| **Bitmap** (.bmp) | |\n| **GIF** (.gif) | opens first frame |\n| **TIFF** (.tiff) | opens first frame |\n| **WebP** (.webp) | opens first frame |\n| **JPEG** (.jpg, .jpeg) | saving disabled because it's lossy (it would destroy your pixel art) |\n| **Windows Icon** (.ico) | opens largest size in the file |\n| **Mac OS Icon** (.icns) | opens largest size in the file; saving disabled because it requires specific sizes |\n| **Windows Cursor** (.cur) | opens largest size in the file; saving not supported by Pillow (and it would need a defined hot spot) |\n\nSee [Pillow's documentation](https://pillow.readthedocs.io/en/stable/handbook/image-file-formats.html) for more supported formats.\n\nNote that metadata is not preserved when opening and saving image files. This is however common for many image editors.\n\n### Tips\n\nYou can draw with a character by clicking the selected color display area in the palette and then typing the character,\nor by double clicking the same area to pick a character from a list.\n\nYou can set the text color by right clicking or holding <kbd>Ctrl</kbd> while clicking a color in the palette.\nAlso, if you double right click or hold <kbd>Ctrl</kbd> while double clicking on a color to open the Edit Colors dialog,\nif will edit the text color when you click OK.\n\nYou can swap the foreground and background colors by right clicking or holding <kbd>Ctrl</kbd> while clicking the current colors area.\nThis is a great convenience, especially when using the Color Eraser tool, or when using custom colors that may be hard to distinguish.\n\nYou can display a saved ANSI file in the terminal with `cat`:\n\n```bash\ncat samples/ship.ans\n```\n\nTo browse the sample art, run:\n\n```bash\npython -m src.textual_paint.gallery\n```\n\nTo preview ANSI art files in file managers like Nautilus, Thunar, Nemo, or Caja, you can install the [ansi-art-thumbnailer](https://github.com/1j01/ansi-art-thumbnailer) program I made to go along with this project.\n\n\n## Known Issues\n\n- Undo/Redo doesn't work inside the Text tool's textbox. <kbd>Ctrl</kbd>+<kbd>Z</kbd> will delete the textbox. (Also note that the Text tool works differently from MS Paint; it will overwrite characters and the cursor can move freely, which makes it better for ASCII art, but worse for prose.)\n- The Text tool's cursor doesn't blink.\n- The selection box border appears inside instead of outside (and lacks dashes). For the text box, I hid the border because it was too visually confusing, but it should also have an outer border.\n- Pressing both mouse buttons stops the current tool, but doesn't undo the current action. Also Pick Color can't be cancelled (with <kbd>Esc</kbd> or by pressing both mouse buttons), since it samples the color continuously.\n- Due to limitations of the terminal, shortcuts using <kbd>Shift</kbd> or <kbd>Alt</kbd> might not work. Menus are not keyboard navigable, because I can't detect <kbd>Alt</kbd>+<kbd>F</kbd>, etc.\n- The Zoom submenu flickers as it opens, and may not always open in the right place. (Fixed?)\n- The canvas flickers when zooming in with the Magnifier tool.\n- Some languages don't display correctly.\n- Large files can make the program very slow, as can magnifying the canvas. There is a 500 KB limit when opening files to prevent it from freezing.\n- The status bar description can be left blank when selecting a menu item. (I think the `Leave` event can come after closing, once the mouse moves.)\n- Menu items like Copy/Cut/Paste are not grayed out when inapplicable. Only unimplemented items are grayed out.\n- ANSI files (.ans) are treated as UTF-8 when saving and loading, rather than CP437 or Windows-1252 or any other encodings. Unicode is nice and modern terminals support it, but it's not the standard for ANSI files. There isn't really a standard for ANSI files.\n- ANSI files are loaded with a white background. This may make sense as a default for text files, but ANSI files either draw a background or assume a black background, being designed for terminals.\n- Hitting Enter in View Bitmap mode may trigger a menu item while exiting the mode. Menu items ought to be disabled when hidden, and View Bitmap should also prevent the key event from taking other actions if possible.\n- Airbrush is continuous in space instead of time. It should keep spraying while the mouse stays still.\n- Error messages may not show up when opening a file fails. I'm not sure how to reproduce this, so if you run into this, do let me know.\n- Edit Colors dialog\n  - Focus ring shows even while grid is not focused\n  - Can show two cells as selected, instead of one across both grids\n  - Custom colors order X/Y is different from MS Paint\n  - Pressing enter in color grid should select color and close\n  - Selection ring is hard to see in dark mode\n  - Focus ring is invisible on a black color cell\n  - When dragging on the color field or luminosity slider, the cursor can be seen to jump back to earlier places where the mouse was, before settling at the current position. (This may only be visible when the program is running slowly, such while debugging. I haven't observed this on the canvas, so maybe it has something to do with the dialog being on a separate layer.)\n  - When opening the Edit Colors dialog, it may immediately close, if the mouse lines up with the \"OK\" or \"Cancel\" buttons. (This doesn't seem to currently happen, but I haven't knowingly fixed it. A git bisect turned up a bogus commit, possibly due to reproducing the behavior being unreliable. It also seems like it might depend on the specific layout of the dialog, which changed during development, and maybe even the terminal size.)\n\n## Compatibility\n\n<!-- PyPI doesn't generate linkable headings -->\n<a id=\"compatibility\"></a>\n\nPython 3.10 or later is required.\n\n### Linux\n\nTested on Ubuntu 22, with GNOME Terminal, Kitty, XTerm, and VS Code's integrated terminal.\n\nGNOME Terminal works best, with crisp triangles used for icons in dialogs, emoji support, and true color support.\n\nKitty works fine, supporting true color and emoji.\n\nXTerm supports true color, but not emoji. Run with `COLORTERM=truecolor textual-paint --ascii-only` for XTerm compatibility.\n\n### macOS\n\nTested on OSX 10.14 (Mojave), with iTerm2, and VS Code's integrated terminal.\n\nIn VS Code, Free-Form Select shows as tofu (a missing character symbol).\n\nThe default Terminal has missing characters, causing misalignment of everything to the right of them, plus borders are not rendered nicely, giving it a sort of *frayed fabric* look, and it's limited to 256 colors.\n\n### Windows\n\nTextual Paint works with the new [Windows Terminal](https://learn.microsoft.com/windows/terminal/install).\n\n#### Pasting in Windows Terminal\n\n[<kbd>Ctrl</kbd>+<kbd>V</kbd> does not work](https://github.com/microsoft/terminal/issues/11267) to paste by default, but **Edit > Paste** does work.\nYou can unbind <kbd>Ctrl</kbd>+<kbd>V</kbd> to fix this:\n- Open Windows Terminal's Settings (<kbd>Ctrl</kbd>+<kbd>,</kbd>)\n- Click \"Open JSON file\"\n- Disable the paste binding by adding `//` to the beginning of the lines:\n  ```json\n  // {\n  //     \"command\": \"paste\",\n  //     \"keys\": \"ctrl+v\"\n  // },\n  ```\n- Save the file, and the behavior should update immediately.\n\nAlternatively, you can use the Actions tab of the Settings UI to remove the binding for <kbd>Ctrl</kbd>+<kbd>V</kbd>.\n\nIf you're wondering why *removing* the Paste binding fixes it, it's because Textual Paint needs to receive the literal <kbd>Ctrl</kbd>+<kbd>V</kbd> key presses in order to trigger its own Paste command.\n\n#### Powershell Problems\n\nRunning in Powershell, you may run into a bug where the powershell prompt becomes active at the same time as the TUI.\nMoving the mouse will redraw parts of the TUI, and it becomes hard to click on things, but still possible.\nCommands can be entered, and the output will be interwoven with the TUI, including if you run a second instance of the program, in which case the two instances will vie for the screen.\nIf this happens, I would recommend first messing around with it, since it's a fun glitch, then opening a new tab in Windows Terminal with the **Command Prompt profile**, available in the new tab dropdown menu.\n\n#### Windows Console\n\nTextual Paint will **not** work properly with the old Windows console (`conhost.exe`), which lacks emoji/Unicode support and true color support.\nThis program is commonly thought of as the \"Command Prompt\", but the Command Prompt (`cmd.exe`) is actually a *shell* (like `bash`) that can run in either the old console or the new Windows Terminal, which are both *terminal emulators*.\n\nYou can run with `--ascii-only` to limit the characters used in the UI to ASCII, but colors will still be limited and similar colors will appear confusingly identical.\n\n### VS Code\n\nNote that VS Code's integrated terminal tries to fix the contrast of text, including in the canvas, which is entirely inappropriate for an ANSI art editor, as it obscures the colors, and can indeed *harm* the contrast of the resulting document, by tricking you into thinking there's more contrast than there actually is.\n\nTo disable this, you can add this to your settings.json:\n\n```json\n\"terminal.integrated.minimumContrastRatio\": 1\n```\n\nIf this doesn't work, try increasing it to 1.1.\n\n\n## Development\n\nFirst, create a virtual environment, and activate it:\n```bash\npython -m venv .venv\n# The activate script is in different places on different systems:\n# Linux/macOS:\nsource .venv/bin/activate\n# Windows:\n.venv\\Scripts\\activate\n```\n\nInstall Textual and other dependencies:\n```bash\npip install -r requirements.txt\n```\n\nRun the app via Textual's CLI for live-reloading CSS support, and enable other development features:\n```bash\ntextual run --dev \"src.textual_paint.paint --clear-screen --inspect-layout --restart-on-changes\"\n```\n\nOr run more basically:\n```bash\npython -m src.textual_paint.paint\n```\n\nOr install the CLI globally\\*:\n```bash\npip install --editable .\n```\n\nThen run:\n```bash\ntextual-paint\n```\n\n\\*If you use a virtual environment, it will only install within that environment.\n\n`--clear-screen` is useful for development, because it's sometimes jarring or perplexing to see error messages that have actually been fixed, when exiting the program.\n\n`--inspect-layout` enables a DOM inspector accessible with F12, which I built. It also lets you apply a rainbow highlight and labels to all ancestors under the mouse with middle click, but this is mostly obsolete/redundant with the DOM inspector now. The labels affect the layout, so you can also hold Ctrl to only colorize, and you can remember how the colors correspond to the labels, to build a mental model of the layout.\n\n`--restart-on-changes` automatically restarts the program when any Python files change. This works by the program restarting itself directly. (Programs like `modd` or `nodemon` that run your program in a subprocess don't work well with a TUI's escape sequences.)\n\nThere are also launch tasks configured for VS Code, so you can run the program from the Run and Debug panel.\nNote that it runs slower in VS Code's debugger.\n\nTo see logs, run [`textual console`](https://textual.textualize.io/guide/devtools/#console) and then run the program via `textual run --dev`.\nThis also makes it run slower.\n\nOften it's useful to exclude events with `textual console -x EVENT`.\n\n### Troubleshooting\n\n> `Unable to import 'app' from module 'src.textual_paint.paint'`\n\n- Make sure to activate the virtual environment, if you're using one.\n- Make sure to run the program from the root directory of the repository.\n\n> `ModuleNotFoundError: No module named 'src'`\n\n- Make sure to run the program from the root directory of the repository.\n\n### Quality Assurance\n\n```bash\n# Spell checking\n# I use the VS Code extension \"Code Spell Checker\", and its associated CLI:\ncspell-cli lint .\n\n# Type checking\n# I use the \"Python\" and \"Pylance\" VS Code extensions, and the Pyright CLI:\npyright\n# I'm targeting zero errors at this version of Pyright:\nPYRIGHT_PYTHON_FORCE_VERSION=1.1.345 pyright\n# I also tried mypy and fixed some errors it reported, but I'm not targeting zero errors with mypy.\nmypy src --no-namespace-packages --check-untyped-defs\n\n# Visual Regression Testing (and a few other tests)\n# I use pytest-textual-snapshot, which is a pytest plugin for comparing SVG screenshots of Textual apps over time.\npytest\n# To accept differences, update the baseline with:\npytest --snapshot-update\n# I also made a test recorder, which can generate test code, which is great for creating tests that interact with the canvas.\n# Run with:\npython tests/pilot_recorder.py\n# Then interact with the app, and press Ctrl+C to stop recording.\n# You can also hit Ctrl+R to replay what you have,\n# or Ctrl+Z to remove the last step and replay the rest.\n```\n\n### Publishing\n\n- Run QA steps above\n- Update version numbers in `setup.cfg` and `src/textual_paint/__init__.py` to a pre-release version (e.g. `0.3.0-pre.1`)\n- Add version header to `CHANGELOG.md` below \"Unreleased\", and update version links at bottom\n- Commit (e.g. `git commit -m \"Prepare v0.3.0\"`)\n- Build package: `python -m build --sdist --wheel`\n- Upload to TestPyPI: (updating version numbers) `python -m twine upload --repository testpypi dist/textual_paint-0.3.0rc1-py3-none-any.whl dist/textual_paint-0.3.0rc1.tar.gz`\n- Test installing from TestPyPI with: (outside the venv, updating the version number) `pipx uninstall textual-paint; pipx install textual-paint==0.3.0rc1 --pip-args \"--index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple textual-paint\"`\n- If all is good, update version numbers to remove `-pre.N` suffixes\n- Amend commit (`git commit --amend --no-edit`)\n- Rebuild: `python -m build --sdist --wheel`\n- Upload to PyPI: `python -m twine upload dist/textual_paint-0.3.0-py3-none-any.whl dist/textual_paint-0.3.0.tar.gz`\n- Push `main` branch (`git push origin main`)\n- Tag and push tag (e.g. `git tag v0.3.0 && git push origin v0.3.0`)\n\n## License\n\n[MIT](https://github.com/1j01/textual-paint/blob/main/LICENSE.txt)\n\n## News\n\nFor a history of changes to the project, see the [changelog](https://github.com/1j01/textual-paint/blob/main/CHANGELOG.md).\n\n## Unicode Symbols and Emojis for Paint Tools\n\nThe first thing I did in this project was to collect possible characters to represent all the tool icons in MS Paint, to gauge how good of a recreation it would be possible to achieve, starting from looks.\nAs it turns out, I didn't run into any significant roadblocks, so I ended up recreating MS Paint. [Again.](https://jspaint.app)\n\nThese are the symbols I've found so far:\n\n- Free-Form Select: \u2702\ufe0f\ud83d\udcd0\ud83c\udd93\ud83d\udd78\u2728\u2606\u269d\u26e4\u26e5\u26e6\u26e7\u269b\ud83e\udee5\ud83c\uddeb/\ud83c\uddf8\u25cc\u205b\u2058 \u28bc\u282e \ud83d\udcff\u27b0\u27bf\ud80c\udf7c\u0d2f\ud83e\udea2\ud80c\udf6f \ud811\uddeb \ud80c\udf72 \ud80c\udf71 \u0c7f \u13ec \u13c8\n- Select: \u2702\ufe0f\u2b1a\u25a7\ud83d\udd32 \u28cf\u28f9 \u26f6\n- Eraser/Color Eraser: \ud83e\uddfc\ud83e\uddfd\ud83e\uddf9\ud83d\udeab\ud83d\udc4b\ud83d\uddd1\ufe0f\u25b0\u25b1\n- Fill With Color: \ud83c\udf0a\ud83d\udca6\ud83d\udca7\ud83e\ude78\ud83c\udf08\ud83c\udf89\ud83c\udf8a\ud83e\udea3\ud83e\uded7\ud83d\udeb0\u26fd\ud83c\udf6f \ua5c3\ufe46 \u2b19\ufe45 \ud83e\udea3\ufe45\n- Pick Color: \ud83c\udfa8\ud83c\udf08\ud83d\udc89\ud83d\udc85\ud83d\udca7\ud83e\ude78\ud83c\udf88\ud83d\udccc\ud83d\udccd\ud83e\ude9b\ud83e\udea0\ud83e\udd4d\ud83e\ude7c\ud83c\udf21\ud83d\udc84\ud83c\udfaf\ud81a\udc61\u2924\ud834\udc03\ud83d\udf6f\u22b8\u26b2\ud80c\udefc\ud83d\udde1\ud80c\udf4a\ud83c\udf76\ud83e\uddea\ud83c\udf7c\ud83c\udf02\ud83d\udc41\ufe0f\u200d\ud83d\udde8\ufe0f\ud83e\uddff\ud83c\udf77\u2935\u2763\u2697 \u2906\u03f7 \u27fd\u00fe \u21d0 c\u27fe /\u0325\u035a\u0325\u0325\u035a\u030a\u035a\u030a\n- Magnifier: \ud83d\udd0d\ud83d\udd0e\ud83d\udc40\ud83d\udd2c\ud83d\udd2d\ud83e\uddd0\ud83d\udd75\ufe0f\u200d\u2642\ufe0f\ud83d\udd75\ufe0f\u200d\u2640\ufe0f\n- Pencil: \u270f\ufe0f\u270e\u270d\ufe0f\ud83d\udd8e\ud83d\udd8a\ufe0f\ud83d\udd8b\ufe0f\u2712\ufe0f\ud83d\udd86\ud83d\udcdd\ud83d\udd8d\ufe0f\ud83e\udeb6\ud83e\ude88\ud83e\udd56\ud83e\udd55\u25aa\n- Brush: \ud83d\udd8c\ud83d\udc68\u200d\ud83c\udfa8\ud83e\uddd1\u200d\ud83c\udfa8\ud83d\udc85\ud83e\uddf9\ud83e\udeae\ud83e\udea5\ud83e\ude92\ud83e\udea0\u2d44\u2443\u1210\u22d4\u22f2 \u25ad\u22f9 \ud834\ude38\u22f9 \u228f\u22f9 \u2e26\u22f9 \u2282\u22f9 \u25ac\u25a4\n- Airbrush: \u26eb\ud83d\udca8\u0434\u159c\ud83d\udca8\u2554\ud83d\udca8\ud83e\uddf4\ud83e\udd64\ud83e\uddc3\ud83e\uddef\ud83e\udde8\ud83c\udf7e\ud83e\udd6b\ud83d\udc88\ud83e\udee0\ud83c\udf2c\ufe0f\ud83d\uddef\u2604\ud83d\udcad\u0f04\u0f3a\u2601\ufe0f\ud83c\udf2a\ufe0f\ud83c\udf2b\ud83c\udf00\ud83d\udebf \u2aa7\ud81a\udd18 \u15d2\u15e3 \u0434\u159c\u15d5\n- Text: \ud83d\udcdd\ud83d\udcc4\ud83d\udcc3\ud83d\udcdcA\uff21\ud83c\udd70\ufe0f\ud83c\udd8e\ud83d\udd24\ud83d\udd20\ud835\udc34\n- Line: \ud83d\udccf\ud83d\udcc9\ud83d\udcc8\uff3c\u27cd\ud834\ude0f\u2572\u29f9\\\u29f5\u2216\n- Curve: \u21aa\ufe0f\ud83e\ude9d\ud83c\udf19\u3030\ufe0f\u25e1\u25e0~\u223c\u2248\u223d\u223f\u301c\u3030\ufe4b\ufe4f\u2248\u224b\uff5e\u2053\n- Rectangle: \u25ad\u25ac\u25ae\u25af\u2796\ud83d\udfe5\ud83d\udfe7\ud83d\udfe8\ud83d\udfe9\ud83d\udfe6\ud83d\udfea\ud83d\udfeb\u2b1b\u2b1c\ud83d\udd32\ud83d\udd33\u23f9\ufe0f\u25fc\ufe0f\u25fb\ufe0f\u25fe\u25fd\u25aa\ufe0f\u25ab\ufe0f\n- Polygon: \u2599\ud835\udddf\ud835\ude47\ufe44\u300f\ud80c\ude8b\u2b23\u2b1f\ud83d\udd36\ud83d\udd37\ud83d\udd38\ud83d\udd39\ud83d\udd3a\ud83d\udd3b\u25b3\u25b2\u2616\u26c9\u2666\ufe0f\ud83d\uded1\ud83d\udcd0\ud83e\ude81\u2734\ufe0f\n- Ellipse: \u2b2d\u2b55\ud83d\udd34\ud83d\udfe0\ud83d\udfe1\ud83d\udfe2\ud83d\udd35\ud83d\udfe3\ud83d\udfe4\u26ab\u26aa\ud83d\udd18\ud83e\udee7\ud83d\udd73\ufe0f\ud83e\udd5a\ud83d\udcab\ud83d\udc8a\ud83d\udede\n- Rounded Rectangle: \u25a2\u2b1c\u2b1b\ud80c\udef0\u2328\ufe0f\u23fa\ufe0f\ud83d\udcb3\ud83d\udcfa\ud83e\uddeb\n\nThe default symbols used may not be the best on your particular system, so I may add some kind of configuration for this in the future.\n\n### Cursor\n\nA crosshair cursor could use one of `+\u271c\u271b\u22b9\u271a\u254b\u256c\u2058\u205b\ud81a\udd54\u2316\u2bd0`, but it might be better to show the pixel under the cursor, i.e. character cell, surrounded by dashes, like this:\n\n```\n \u257b\n\u257a\u2588\u2578\n \u2579\n```\n\n## See Also\n\n- [JavE](http://jave.de/), an advanced Java-based ASCII art editor\n- [Playscii](http://vectorpoem.com/playscii/), a beautiful ASCII/ANSI art editor. This is also written in Python and MIT licensed, so I might take some code from it, for converting images to ANSI, for example. Who knows, maybe I could even try to support its file format.\n- [cmdpxl](https://github.com/knosmos/cmdpxl), a pixel art editor for the terminal using the keyboard\n- [pypixelart](https://github.com/douglascdev/pypixelart), a pixel art editor using vim-like keybindings, inspired by cmdpxl but not terminal-based\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "MS Paint in the terminal, built with Textual",
    "version": "0.4.0",
    "project_urls": {
        "Changelog": "https://github.com/1j01/textual-paint/blob/main/CHANGELOG.md",
        "Homepage": "https://github.com/1j01/textual-paint",
        "Source": "https://github.com/1j01/textual-paint"
    },
    "split_keywords": [
        "tui",
        "terminal",
        "paint",
        "drawing",
        "art",
        "graphics",
        "text",
        "textual",
        "rich",
        "ansi",
        "ansi-art",
        "mspaint"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "71ca7929fa18b01403682da3180fedfcfeebabaa5a7e6ad773821a4e8cc7da64",
                "md5": "cc1dd352e9f76fb116065526099c9509",
                "sha256": "c01b885bddd67bbf61003387e625aeacb8231677d93be493c67676bb298f8fa9"
            },
            "downloads": -1,
            "filename": "textual_paint-0.4.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cc1dd352e9f76fb116065526099c9509",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 411988,
            "upload_time": "2024-01-11T22:49:09",
            "upload_time_iso_8601": "2024-01-11T22:49:09.472473Z",
            "url": "https://files.pythonhosted.org/packages/71/ca/7929fa18b01403682da3180fedfcfeebabaa5a7e6ad773821a4e8cc7da64/textual_paint-0.4.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4855175188382d049b6f854dec7e88f0e03d3d6e5b4b85d826af5805923eca9e",
                "md5": "a0aa59e628e1b4d1094401a3fe87e45b",
                "sha256": "87b42e39718ef1b627d14601d13acea224c9ac5991031edbc66da228c1b03b0e"
            },
            "downloads": -1,
            "filename": "textual_paint-0.4.0.tar.gz",
            "has_sig": false,
            "md5_digest": "a0aa59e628e1b4d1094401a3fe87e45b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 753294,
            "upload_time": "2024-01-11T22:49:11",
            "upload_time_iso_8601": "2024-01-11T22:49:11.809724Z",
            "url": "https://files.pythonhosted.org/packages/48/55/175188382d049b6f854dec7e88f0e03d3d6e5b4b85d826af5805923eca9e/textual_paint-0.4.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-11 22:49:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "1j01",
    "github_project": "textual-paint",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "textual-paint"
}
        
Elapsed time: 0.16318s