A small TUI that lets you create 32x32 px images (scalable by n factor) with 10 different colors and two tools.
Features of this TUI:
- Initiates with a UI that shows the:
- canvas (32x32 px),
- currently selected tool,
- currently selected color,
- all the controls,
- coordinates of cursor,
- command line where cancel-confirmation and export-name and export-extension-selection happens.
- Pencil and naive bucket tool (fills whole screen)
- Can draw with these colors: White, Black, Red, Orange, Yellow, Green, Cyan, Blue, Magenta, Brown
- Can export to new
.ppm,.png, or.jpgfile with a given name, with the option to scale the image by any integer from 1–9999. - Can cancel file (with y/n confirmation)
- The cursor may be hidden, or visible, marked by textured pixels.
- Each pixel is 1 character in height and 2 characters in width.
Limitations:
- Cannot save nor load files in progress
- Cannot create files with screen sizes other than 32x32 px
- Cannot use arbitrary colors
Clanguage (C99)termiosbuilt-in library.
-
File:
e: export (command line asks to specify name and extension)c: cancel (command line prompts for confirmation)
-
Cursor:
i: hide cursorh: leftj: downk: upl: rightm: go to left edge,: go to down edge.: go to up edge/: go to right edge
-
Tools:
p: Select pencilb: Select bucket;: Next toolu: Use tool
-
Select Color:
n: Next color (loops around)N: Previous color (loops around)1: White,2: Black,3: Red,4: Orange,5: Yellow,6: Green,7: Cyan,8: Blue,9: Magenta,0: Brown,
Mini Paint TUI // title
----------------------------------------------------------------
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| CANVAS (64x32 chars; looks like 32x32 px) |
| (Will look off on GitHub) |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
----------------------------------------------------------------
// x & y are cursor coordinates
(x, y) | Tool: Pencil | Color: white (WBROYGCBMB) // selected color will be underlined; letters are color-coded
`e` export `c` cancel `u` use tool `p` pencil `b` bucket
`n` next color `N` prev color `1-9` pick color `;` next tool `i` hide cursor
`hjkl` l/d/u/r `m,./` go to l/d/u/r edge
Last Export Log: File example.png successfully exported. // Visible after exporting file
Cancel? y/n > // command line (pops up on export & discard commands)Inspired by the video Graphics API is irrelevant by Tsoding on YouTube, which showcases how animations can be made from raw pixels which are then manipulated with algorithms.
