-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanual.txt
695 lines (564 loc) · 60.6 KB
/
manual.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
=================================================================
REXPaint v1.60 - Manual
=================================================================
A powerful and user-friendly ASCII art editor.
-----------------------------------------------------------------
Background
-----------------------------------------------------------------
There are a number of ASCII art editors available on the web, but most suffer from poor usability or small feature sets (one notable exception being eigenbom's awesome fork of ASCII Paint). For development of my own projects, I needed an application equipped with a wide range of tools for quickly drawing and manipulating ASCII art, as well as the ability to easily browse the images created as stored in their native format. Thus REXPaint was born.
Over the years since its first public release, REXPaint has found use as a general purpose ASCII art editor, as well as a roguelike development tool for mockups, mapping, and design. I love seeing what people create with this program, so send me a link/copy if you've made something cool! (Or share it with us on the forums: www.gridsagegames.com/forums/index.php?board=8.0)
-----------------------------------------------------------------
Features
-----------------------------------------------------------------
An overview of REXPaint's major features:
* Edit characters, foreground, and background colors separately
* Draw shapes and text
* Copy/cut/paste areas
* Undo/redo changes
* Preview effects simply by hovering the cursor over the canvas
* Palette manipulation
* Image-wide color tweaking and palette swaps
* True-color RGB/HSV color picker
* Create multi-layered images
* Zooming: Scale an image by changing font size on the fly
* Custom fonts and support for extended characters and tilesets
* Browse art assets and begin editing at the press of a button
* Images highly compressed
* Export PNGs for use in other programs or on the web
* Export .ANS files for ANSI art
* Other exportable formats: TXT, CSV, XML, XPM, BBCode, C:DDA
* Import .TXT files
* Skinnable interface
-----------------------------------------------------------------
Table of Contents
-----------------------------------------------------------------
* Canvas
Resizing
Shifting
* Drawing
Apply
Draw Modes
Text Input
Preview
Undo
* Fonts
Glyphs
Glyph Swapping
Custom and Extended Fonts
Custom Glyph Mirroring
Custom Unicode Codepoints
* Palettes
Selection & Editing
Color Picker
Palette Files
Extraction
Adding
Organization
Palette Swapping
Transparency
* Layers
Control
Active Layer
Order
Visibility & Locking
Merging
Extended Layers Mode
* Browsing
File/Image Control
Viewing & Editing
Saving
Exporting
* Customization
Options
Skins
* Commands
* Appendix A: Known Issues
* Appendix B: .xp Format Specification
* Appendix C: External Libraries and Tools
* Appendix D: ANSI Art (.ans)
* Appendix E: Exportable Text Formats (.txt, .csv., .xml, BBCode)
* Appendix F: Importing Text Files
* Appendix G: Importing PNGs
* Appendix H: Batch Exporting PNGs
* Appendix I: Exporting ANSI art for C:DDA
-----------------------------------------------------------------
Canvas
-----------------------------------------------------------------
The black area to the right of the tool menus is the canvas view where all image editing occurs, and the image itself initially appears as a box outline that defaults to the size of the entire canvas view.
Resizing
----------
Resize the image as necessary (Ctrl-r), ideally before starting to draw so that later changes are not affected by a change in image dimensions. Resizing can be done at any time, but the dimensions are always based from the top-left corner of an image, so make sure the portion of a larger image you wish to retain is based in the top-left corner before shrinking it (move the relevant section with the copy tool).
Shifting
----------
To view different parts of a large image (or reposition a smaller one), hold spacebar while left-clicking on the image and moving the mouse to drag it (Photoshop style). The numpad can also be used for eight-directional shifting of the image, Enter resets its location, and Ctrl-Enter centers it.
-----------------------------------------------------------------
Drawing
-----------------------------------------------------------------
Apply
-------
The apply menu determines what is actually produced by the current draw mode when you left-click on the image. Glyphs (characters), foreground color, and background color are each drawn/edited separately, and can be individually toggled on and off via the menu buttons or 'g', 'f', and 'b'. Thus if you activate "glyph" and deactivate "fore" and "back," when you draw only the current glyph will be applied, while the image's colors remain unchanged. Activating all modes will overwrite the glyph and both foreground and background colors when drawing. (Turning all apply modes off would draw... nothing, and be completely pointless!)
The colors to be applied are shown to the right of their button, and the current glyph is that highlighted/chosen among the characters in the font box. Change the glyph by left-clicking on a different one in the font box, and change the colors by either left-clicking on the color square (see Color Picker explanation further below) or chosing a color from the palette (LMB choses a color for the foreground, RMB for the background).
Draw Modes
------------
Drawing modes define the shape and area of the image affected while drawing. Only one mode can be active at a time, and some modes have an alternate setting that changes their behavior (left-click on the active mode to toggle its secondary feature, or cycle through them if more than one).
Cell ('c'): Applies the effect to a single "cell" (space) on the image. Hold LMB and move the cursor to keep drawing. Alternate mode: Auto-wall/auto-box drawing. While the current glyph is any of the single or double line characters (but not a single-double intersection), drawn lines and all adjacent lines of the same type (single/double) will be automatically reoriented to connect with one another. This is useful for creating map walls or boxes. Has no effect for other (non-line) glyphs, which will be drawn normally.
Line ('l'): Applies the effect to a line. Left-click at the line's start and release the button at its end, or press RMB/ESC before releasing the button to cancel the line.
Rect ('r'): Applies the effect to a rectangular area. Left-click at one corner of the rectangle and release the button at the opposite corner, or press RMB/ESC before releasing the button to cancel the rectangle. Alternate mode: Fills the entire rectangle instead of drawing an outline. Non-filled rects drawn with any line glyph will automatically create a properly oriented ASCII box.
Oval ('o'): Like rect mode, but draws ovals. Alternate mode fills the oval. By default ovals are centered on the point chosen; to instead draw from any corner switch the oval drawing method via Alt-o.
Fill ('i'): Applies the effect to all like cells attached to the one under the cursor. When comparing cells, fill mode only checks the attributes for which the apply mode is currently active. For example, if foreground color is the only active apply mode then fill mode propagates to all those attached cells with the same foreground color, regardless of their glyph or background color. Alternate Mode: Fill search is performed in 8 directions rather than 4, allowing the fill to travel along diagonals through obstacles.
Text ('t'): Types text onto the image. See the Text Input section below for a list of valid commands.
Copy (Ctrl-c): Copies a rectangular area of the image into the clipboard for later pasting. Always copies all attributes (glyph and colors) of the regardless of current apply settings. Alternate mode: Cut (Ctrl-x). Cut mode erases everything in a certain area after storing it to the clipboard. Note that if the Paste tool is in an alternate mode, any copy actions also automatically mirror the copied contents to match that mode.
Paste (Ctrl-v): Paste the clipboard contents to the image. While the copy/cut command stores all glyph and color information, only those attributes for which the apply mode is currently active will by pasted. Alternate modes: Flip clipboard contents horizontally, vertically, or both. By default this also automatically converts any non-symmetrical glyphs with mirror images (to flip by position only and leave glyphs unchanged set "Paste-flip ASCII" to No in the options menu). You can also override or customize flipping behavior for specific glyphs (see the Fonts section).
Preview
---------
While the cursor is hovering over the image, applicable draw modes (cell, fill, paste) will show a preview of what the image will look like assuming a left-click at that location. Remember this is true even for fill mode, which may cause the image to appear quite different, but is great for quickly visualizating changes without having to do a lot of applying and undo-ing. To temporarily hide the preview and see the image as it is, hold Shift or Alt.
Undo
------
All image manipulation actions can be undone/redone (Ctrl-z/Ctrl-y, or just z/y). Undo histories are also saved separately for each image, thus you can freely switch between images in the browser and still come back to undo changes from a previous image. (Closing the program, however, will forget all undo states!)
-----------------------------------------------------------------
Fonts
-----------------------------------------------------------------
Images themselves do not store font information, instead remembering only what glyph/character index belongs at each position. This means you can dynamically change the size and/or appearance of an image by simply switching the font (Ctrl-PgUp/Dn or '<'/'>').
Glyphs
--------
Select a glyph to draw with by clicking on it in the font window. Once you have a partially-drawn image the fastest way to load a previously used glyph, including even its foreground/background colors, is to simply right-click on it in the image.
For reference you can toggle highlighting of all used glyphs by pressing 'u' (the highlights are updated only every five seconds, and will be slow in the case of massive images since the entire image must be searched for matches--not recommended to leave this mode on when editing especially large images). To see where a specific glyph has been used in the image's currently active layer, hold Alt while hovering the cursor over it in the font window.
Glyph Swapping
----------------
To replace every occurence of a glyph in all visible unlocked layers of an image, Shift-LMB on it in the font window, then Shift-LMB on the new glyph to replace it with. After selecting a source glyph, the swap can be cancelled by again pressing Shift-LMB on the same glyph.
Custom and Extended Fonts
---------------------------
By default, both the GUI and images use a standard 256-glyph Code Page 437 font. REXPaint makes this same font available at several sizes (and changes #254 and #255 to radio boxes). You can edit these fonts (in the "data/fonts/" directory), and/or add new ones by creating a new .png bitmap and listing it in the "data/fonts/_config.xt" text file. Fonts do not require square glyphs (rectangles are okay), but both the GUI and Art font must use the same glyph dimensions.
When creating a custom font you could even replace some or all of the glyphs/characters/symbols, though you'll probably want to leave the GUI font unchanged so the interface appears as expected (notice how _config.xt defines the GUI and art fonts separately--they do not have to use the same font!). Note that custom fonts always treat index 32 as a space, regardless of what the font bitmap contains there.
Although the default number of rows in a font bitmap is 16, and that is the largest number REXPaint will display at once in the glyph selection area, fonts with additional rows are supported, essentially allowing space for an unlimited number of glyphs in an image. Simply specify the proper number of rows available for the relevant art font in _config.xt and it will be loaded normally (16 columns is still a requirement), then you can use PgUp/Dn or the scroll wheel (with cursor in the glyph area) to see and use glyphs beyond #255. The mouse scrolling rate can be adjusted in REXPaint.cfg via glyphScrollRowCount. If any art fonts have more than 16 rows, the font window will display numbers at the top right indicating the number of rows currently above and below the current view. To make it easier to use large tilesets, by default right-clicking on an image glyph to select a glyph currently outside the viewable glyph window does not automatically scroll the view to show it unless you right-click on the same selected glyph a second time, though you can overide this behavior and have it always scroll immediately by setting glyphSelectAlwaysAutoscrolls in REXPaint.cfg.
If an image containing glyphs beyond #255 previously saved by REXPaint is later loaded into a copy of REXPaint that does not currently have any fonts large enough to include the required indices, it will have those glyphs temporarily converted to spaces. This does not affect the image file itself, and saving such an image will be blocked by REXPaint in order to avoid losing data, although this block can be circumvented in REXPaint.cfg via noSaveForOutOfBoundsGlyphs if required. Any images found to have out-of-bounds glyphs are marked by an asterisk in the browser (blue by default).
Notice in _config.xt that each art font also includes two additional parameters: Unicode and Mirror. These specify two text files, also expected to be found in the "data/fonts/" directory, which define code points for UTF8 text exporting and glyph mirroring behavior for the paste tool, respectively. The default files provided are compatible with a standard CP437 layout. If neither of those features is required for a given font, using the default files is fine, or even just insert a single hypen ('-') for a filename there and it will be ignored. See the sections below for more information on customizing these features.
One supported bitmap feature not used by the included fonts is alpha transparency. Font bitmaps are drawn as white on black, but know that using shades of gray will cause the foreground color to be semi-transparent to a degree equal to the shade of gray (e.g., pixels drawn using 128,128,128 gray will apear as 50% transparent). Also, even though they may only use two colors, bitmaps must be saved as 32-bit pngs (using 8-bit pngs will crash REXPaint). The font bitmap can use any background color, where REXPaint will automatically detect it by checking the upper leftmost pixel (at 0,0). By extension, if the glyph at the first position wants to use that pixel, REXPaint will not be able to automagically detect the background color; in this situation, you can override the background color key with a specific RGB color in REXPaint.cfg via fontKeyColorOverride.
Custom Glyph Mirroring
------------------------
While the Paste tool's alternate mode can mirror CP437 glyphs, with custom fonts using some other layout it is often desirable to specify different sets of glyph pairs for this purpose. You can do this by creating a new text file in the "data/fonts/" directory that defines pairs and assign it to its respective font in _confit.xt via the Mirror column. See the default CP437 _mirror.txt file for an example of the required layout. Each line should specify a single pair, and indicate whether the mirroring direction is horizontal (h) or vertical (v). Indices start from 0 and proceed in row-major order, as displayed in the font bitmap. Add optional comments at the end of a line by preceding them with two slashes.
Custom Unicode Codepoints
---------------------------
By default, images exported as text use UTF8 code points based on the CP437 layout, but some users might want to either override those values or specify UTF8 code points for glyphs outside the CP437 range when using extended custom fonts. You can do this by creating a new text file in the "data/fonts/" directory that defines Unicode code points and assign it to its respective font in _confit.xt via the Unicode column. See the default CP437 _utf8.txt file for an example of the required layout. Each line should specify a single glyph index followed by its decimal code point. Indices start from 0 and proceed in row-major order, as displayed in the font bitmap, and any index not specified in the file will produce a '?' where an imagine using that glyph is exported. Add optional comments at the end of a line by preceding them with two slashes.
-----------------------------------------------------------------
Palette
-----------------------------------------------------------------
Palettes in REXPaint are tools intended purely for color selection and organization, thus images themselves do not store palettes (i.e., image colors are not "indexed") and you can edit images without ever touching the palette. That said, palettes provide a convenient way to unify/standardize colors across multiple images, along with a variety of other color manipulation features.
Selection & Editing
---------------------
Left-clicking on a palette color (including an "empty" space, which is actually black) will select it as the foreground color; right-clicking selects it as the background color. Clicking on the same color again will allow you to edit it in the color picker (see below). Shift-clicking will also open the color picker, but once the new color is confirmed will also replace all matching colors in the image (applied to foreground and/or background, depending on which apply modes are active at the time, NOT whether LMB/RMB used).
To see where a specific color has been used in the image's currently active layer, hold Alt while hovering the cursor over it in the palette window.
Color Picker
--------------
The color picker is fairly straightforward--its features and layout are taken from Photoshop for those familiar with it. Left-click on a color to select it (you can also hold LMB and move the cursor to watch the new color and its values change), and click on it again to accept it (or press the OK button or Enter key). Alternatively, choose a precise color by specifying HSV/RGB number values (click on the number, or press 'h'/'s'/'v'/'r'/'g'/'b' for faster entry).
By default the slider will be in hue mode, but you can set it to saturation or brightness mode by left-clicking on the corresponding box seen next to the S/V values.
Palette Files
---------------
Any number of palettes can be created by clicking on the '+' button (switch between them with the buttons or '['/']' keys). New palettes are unnamed until saved (click on the 'S'), when they are stored in a text format in the "data/palettes/" directory. The files can be modified in any text editor (turn off line wrapping), though editing is generally most conveniently handled directly in the editor itself. Knowing where the palettes are stored can be useful for making copies or saving them to another location for safe-keeping. (You can also rename them, as the file name is the name displayed in REXPaint.)
Remember to save a palette again after making any changes you want to keep (palettes are not automatically saved). Palette changes are NOT recorded as part of the undo history, so changes are permanent unless you previously saved a copy of the palette file.
Colors can of course be edited directly in the palette file, using and of the four color formats described in the skins.xt file: named colors, RGB, HSV, or HEX (individual colors can even used different formats).
Extraction
------------
Pressing Ctrl-Shift-e will create a new empty palette, then add to it all unique foreground and background colors found in the current image.
Adding
--------
Right-clicking on the foreground or background color shown in the apply menu will add it to the palette at the first empty (black) space found, if available. This can be useful when colors were created using the color picker through the apply menu before later deciding to add them to the palette.
Organization
--------------
There are several commands that enable you to manipulate the palette itself for organizational purposes:
Ctrl-Shit-o: Organize. Rearranges the palette colors by moving them into hue-major order. It doesn't always look perfect, but it's better than nothing if you have a horribly messy palette (and is a good place to start from when manually organizing such a palette).
Ctrl-Shift-p: Purge. Removes from the palette all colors not found in the current image.
Ctrl-LMB: Manual relocation. Control-click on two different palette positions to swap those two colors. As empty palette positions are actually black, you can safely "move" colors to these empty positions as well.
CMB: Click on a source color, then on a target position (may be in the same or a different palette) to copy the source color. Useful for more quickly creating different variations/shades of a color when building a palette.
Palette Swapping
------------------
You can mimic a "palette swap" in the traditional sense by opening the target image and source palette and pressing Ctrl-Shift-w, then opening the target palette and pressing Ctrl-w. This will change all colors found in both the image and source palette to those colors found at the same position in the target palette. After setting the source palette you can apply the target palette to any number of other images.
To swap all instances of a single color throughout an image (foreground and background, all layers) with another in the same palette, Shift-LMB on the first color and then Shift-LMB on the color you want to change it to.
Color Shifting
----------------
Having a properly set up palette (ideally with shades of colors listed by row) also enables you to easily shift individual colors directly on an image to quickly get/test the right color/shade without manually selecting them in the palette every time. Hold Shift and use the left and right mouse buttons on the image to shift the foreground color based on its position in the palette (black and white palette positions are skipped); use Alt instead for background color. This only works for colors found in the current palette.
Alternatively, press Shift-h/s/v to activate the respective HSV shifting mode, in which using the left/right mouse buttons and Shift/Alt as indicated above will instead tweak that characteristic of the target cell's foreground/background, completely ignoring palette colors. Return to palette-based shifting mode by toggling the current HSV shifting mode again.
Transparency
--------------
You'll notice the default palette appears to have a missing color, as does the color picker's hue slider. The color is actually there, but it's a background color set to 255,0,255 (hot pink) which REXPaint uses to identify transparent cells. This means two things: 1) It is impossible to use 255,0,255 as a background color in an image (as a foreground color it's okay), and 2) You can create mult-layered images where upper layers contain transparent sections through which lower layers are visible. Draw using the transparent background color to create a transparent cell/area, but know that the glyph and foreground must not be applied (deactivate them) because a transparent background will be automatically converted to black in order to make sure the foreground is visible in that case.
-----------------------------------------------------------------
Layers
-----------------------------------------------------------------
Use of layers is completely optional, and a majority of users will probably do just fine with the single layer automatically created for an image. Layer functionality exists mostly for the workflow/editing benefits of keeping different components of an image on separate layers, or perhaps having alternate versions of a certain part of the image. Other advantages are limited since layers cannot currently be blended.
Control
---------
Each image automatically comes with one base layer (required). More can be created with Ctrl-l or by clicking on the layer window's '+' button. A single image can have up to nine separate layers, and all newly created layers are automatically filled with transparent cells (255,0,255). Press the "X" button to delete a layer (deletion is not possible if there is only one layer remaining).
Active Layer
--------------
The "active layer" is the one which effects are applied to when drawing to the image--its number will appear highlighted. Change the active layer by clicking on a different number, pressing 1~9, or using the mouse wheel while the cursor is over the canvas area.
Order
-------
Layers are listed in top to bottom order, and their order determines which are drawn on top, so opaque parts of higher layers will obscure those portions of lower layers. The relative order of layers can be changed by clicking on the arrow buttons.
Visibility & Locking
----------------------
Individual layers can be hidden from view, but the active layer must always be visible. (To hide the active layer, select a different layer first.) Note that while hidden layers are always saved as normal with the image data, they are NOT drawn when the image is exported, so make sure the image appears as intended before exporting.
Any layer can be locked (Shift-# or the "Lck" button), which prevents editing it even by accident.
Merging
---------
Use the Ctrl-Shift-m command to merge the active layer downward, permanently combining it with the one below. Only the base layer cannot be merged (as there is nothing under it). This action is irreversible, so use it carefully.
Multi-layer Editing
---------------------
The copy/cut/paste tools in particular can work across multiple layers at once, simultaneously copying the same area from more than one layer. To get this effect, use 'd' to increment the amount of depth you want to manipulate. While the depth is greater than 1, additional layers below the current active layer will be included in each operation. For example, using a depth of 2 to copy an area from layer 4 will add that area from both layer 4 and 3 to the clipboard, and maintaining the same depth value while pasting to layer 2 will paste the layer 4 contents on layer 2, and layer 3 contents on layer 1.
Nothing will copy from intermediary hidden layers, and nothing can be cut from locked layers (though the copy portion of a cut operation will still work on that layer). Nothing will paste into intermediary hidden or locked layers, either.
Shift-d decrements the depth counter.
Extended Layers Mode
----------------------
While a single image may include up to nine layers, normally only the lowest four of those will be listed in the Layers window. To view more than that, click the 'E' or press Ctrl-Shift-l to toggle Extended Layers Mode, which will cover the Info window but allow as many as nine layers to be listed at once. If you're using hotkeys for layer control, those will still work as usual even if those layers are not currently visible in the list.
An '*' appears at the top right of the Layers window if an image contains more layers than currently listed, or it will instead show the layer number if a non-listed layer is currently active.
Note that while Extended Layers Mode is active, the options and help menus are inaccessible, as they are normally opened via the Info window, which will be covered.
-----------------------------------------------------------------
Browsing
-----------------------------------------------------------------
Switch between paint mode and browse mode by clicking on the buttons at the top of the menu area or with the Tab key. Browse mode allows you to view all the images created by REXPaint as found in the "images/" directory and any of its subdirectories (use Windows to add any subdirectories you need for organizational purposes, though note that file tree branches will be ignored beyond/deeper than four levels).
File/Image Control
--------------------
You'll notice there is always one unnamed image created on startup; you don't have to modify or save it unless you want to. Additional new/empty images can be created by pressing Ctrl-n or through the New button in paint mode--these are added to the base path ("images/" by default). To create an empty image in a specific subdirectory, simply left-click the directory name.
Realize that browse mode is mostly an image browser, not a full-featured file manager, so actions like image moving, directory operations, etc. should be performed through Windows. You can, however, rename (RMB), duplicate (Shift-LMB) and delete (Ctrl-Shift-Alt-LMB) images from here. Image deletion is permanent, so be careful with it!
Feel free to create additional subdirectories under REXPaint's "images/" directory, as those will also be shown in the browser, and may be collapsed/expanded as well.
While REXPaint is open, you can reload all image files to reflect changes at the file system level via Ctrl-Shift-r or the "R" button at the bottom of the browser. Of course you'll lose any unsaved images or progress, but you'll be warned if that will happen. Once complete, the reloading process will do its best to restore the original browsing state and selected image.
Viewing & Editing
-------------------
Images do not need to be explicitly opened in REXPaint. When the program starts, all images are loaded into memory and you can browse through them by clicking on their name in the browser or pressing up/down (see Commands below for more list controls), then edit any of them immediately by switching over to paint mode. Copy-paste also works normally between different images (i.e. you can copy from one image to another).
Saving
--------
When changes are made to an image, an indicator will appear next to its name in the browser, as well as in the top-left corner of the paint mode window. The browser menu also shows the total number of unsaved images to the top left. Save the image to remove the indicator. Saving can be done from either browse or paint mode with Ctrl-s or the Save button.
Exporting
-----------
Unless you're drawing art for my game you'll probably want to use your image elsewhere, and REXPaint's compressed .xp format won't be very useful. Use the Export button (or Ctrl-e) to save the current image as a .png file (can be done from either paint or browse mode). By default, the new file can be found in the "images/" directory.
When exporting, remember that 1) font size matters and 2) hidden layers are not exported; essentially, the image will be exported exactly as you see it (minus any draw preview seen when the cursor is hovering over the image).
Exporting to .ans is also possible (see Appendix D).
Export as an .xpm image (X PixMap) by pressing Ctrl-p (see http://en.wikipedia.org/wiki/X_PixMap).
Other exportable formats include TXT (ctrl-t), CSV (ctrl-k), XML (ctrl-m), and BBCode (ctrl-b) (see Appendix E).
-----------------------------------------------------------------
Customization
-----------------------------------------------------------------
Options
---------
The first time REXPaint is run, it will create a new REXPaint.cfg file using the default options. It's generally not necessary to edit this file directly, as options may be modified through an in-program options menu (F3), and all changes are saved when the program is closed. Delete the file while REXPaint is not running to have it reset all values to defaults when next started.
There are currently several options not mentioned elsewhere in the manual, implemented by request, which require editing REXPaint.cfg to take advantage of:
* unlimitedFontSize: Setting this value to 1 loads all fonts, even those which will allow extreme zooming where it produces a window which doesn't fit on the screen! This is far from ideal usage of REXPaint, but may be helpful in special circumstances.
* txtOutputUTF8: Whether the TXT export should use UTF8 encoding instead of pure ASCII characters. The former uses unicode hard spaces, which you may not want depending on your use case.
* baseImagePath: Set to the base path from which to load images into the browser, relative to the .exe location. As a relative path it can use "../" to move to higher directories.
* exportsToBase: Whether exported files are always placed in the base image path, rather than to the same path as their source image which may be in a subdirectory.
* ignorePath: Use this to specify one or more paths (relative to the baseImagePath) which will be ignored by the image loader so that even those directories (and all subdirectories and their contents) will not appear in the file browser. You can list as many separate paths as you like by using ignorePath on a separate line for each.
Skins
-------
REXPaint comes with several different skins; press F4 to cycle through them. You can edit them, or add more, by setting the colors in "data/skins.xt" (open as a text file).
Additional Resources
----------------------
See the online resource repository (http://www.gridsagegames.com/rexpaint/resources.html) for additional user-submitted resources like fonts and palettes, and feel free to send in your own if you feel you've created something that would benefit the community. There you'll also find palettes and fonts for a large number of legacy systems like the Apple II, Atari 2600, Commodore 64, NES, ZX Spectrum, and many more.
A guide to using REXPaint for mockups, art, prefabs and more, with specific techniques and plenty of reference images, can be found here: http://www.gridsagegames.com/blog/2015/07/roguelike-development-rexpaint/
Developers see Appendix C for links to existing libraries and tools capable of interfacing with REXPaint files.
-----------------------------------------------------------------
Commands
-----------------------------------------------------------------
Many commands that are either obvious or too advanced are not listed in REXPaint's F1/? help screen. Below is a complete list of all currently supported commands (advanced commands are explained in the relevant section of the manual above):
Font
------
Ctrl-PgUp/Dn / </> Change Font (Scale Image/UI)
Ctrl-Wheel Change Font (Scale Image/UI)
LMB Select Glyph
Arrows Shift Selection
Wheel / PgUp/Dn Scroll View to Extended Glyphs (if present)
Home/End Scroll View to First/Last Extended Glyph Page (if present)
u Toggle Used Glyph Highlighting (slow for massive images)
Alt (hold) Highlight Hovered Glyph in Current Layer
Shift-LMB x2 Swap Occurences of Glyph 1 with Glyph 2
Palette
---------
[/] Change Palette
LMB (x2) Set (Edit) Foreground Color
RMB (x2) Set (Edit) Background Color
Shift-LMB x2 Swap Occurences of Color 1 with Color 2
Alt-LMB (x2) Edit and Replace Foreground Color in Image
Alt-RMB (x2) Edit and Replace Background Color in Image
Ctrl-Shift-o Organize Palette
Ctrl-Shift-e Extract Image Palette
Ctrl-Shift-p Purge Unused Colors
Ctrl-LMB x2 Swap Palette Colors (source -> target)
Ctrl-Shift-w Set Palette Swap Source
Ctrl-w Swap Image Palette
CMB Set Color Copy Source/Target
Alt (hold) Highlight Hovered Color in Current Layer
Drawing
---------
c (x2) Cell (Auto-walls)
l Line
r (x2) Rectangle (Filled)
o (x2) Oval (Filled)
Alt-o Toggle oval drawing method (center/corner)
i (x2) Fill (8-direction)
t Text
Ctrl-c Copy
Ctrl-x Cut
Ctrl-v (x2) Paste (Flip)
ESC / RMB Stop/Cancel
Text Tool
-----------
Enter Confirm
Ctrl-Enter Confirm current text and start new line directly below it
Escape Cancel
Left/Right Arrow Move caret left/right (insert characters anywhere in text)
Ctrl-Left/Right Arrow Move caret to beginning/end of text
Home/End Move caret to beginning/end of text
Backspace Delete character before caret
Ctrl-Backspace Delete all text before before caret
Delete Delete character at caret position
Ctrl-Delete Delete all text from caret to the end
Up/Down Cycle through text history (previously confirmed text) for reuse/editing
Apply
-------
g (G) Toggle (Solo) Glyph
f (F) Toggle (Solo) Foreground Color
b (B) Toggle (Solo) Background Color
LMB Edit Color
RMB Add Color to Palette
Alt-w Swap Foreground/Background Colors
Shift-Alt-r/g/b Toggle Foreground Color Channel Application (all tools)
Ctrl-Shift-Alt-r/g/b Toggle Background Color Channel Application (all tools)
d Increment Copy/Cut/Paste Layer Depth (Shift-d decrements)
Canvas
--------
Spacebar (hold) Enter Drag Mode
LMB Hold Canvas to Drag
Numpad Shift Canvas
Shift-Wheel Scroll Image Up/Down
Enter Reset Image Location
Ctrl-Enter Center Image
RMB Copy Cell Contents (Applied Modes Only), where source is current layer
Ctrl-RMB As RMB, but from uppermost visible layer (useful for reference layers)
Shift/Alt (hold) Hide Preview
Shift-Arrow/Numpad Shift all layers in indicated direction (wraps)
Shift-Ctrl-Arrow/Numpad Shift active layer in indicated direction (wraps)
n Toggle Explicit Transparency Mode
Shift-Alt-n Toggle Explicit Transparency Color Set
Shift-h/s/v Switch Color Shift Mode (repeat same to restore to P mode)
Shift-LMB/RMB Apply Color Shift to Foreground (Prev/Next or Down/Up, whichever appropriate)
Alt-LMB/RMB Apply Color Shift to Background (Prev/Next or Down/Up, whichever appropriate)
Shift-Alt-w Swap foreground/background colors throughout active layer
Ctrl-Shift-Alt-w Swap foreground/background colors throughout image
Ctrl-Shift-c Copy Entire Active Layer (to clipboard) (does multi-layer copy if selected depth > 1)
z/Ctrl-z Undo
y/Ctrl-y Redo
Ctrl-d Toggle Rect Dimension Display (for drawing/selecting a rectangle; also "RDim" button)
Ctrl-g Toggle Grid
Alt-Wheel Change Grid Resolution
Alt-g Toggle Grid Under Mode (Show in Undrawn Areas Only)
Ctrl-Tab Switch between current/latest image
Ctrl-Up/Down Edit Previous/Next Image (even in Paint mode)
Layers
--------
Ctrl-l New Layer
Wheel Cycle Active Layer
1~9 Activate Layer
Ctrl-1~9 Toggle Layer Hide
Shift-1~9 Toggle Layer Lock
Ctrl-Shift-m Merge Active Layer
Ctrl-Shift-l Toggle Extended Layers Mode
Info
---------
q Toggle Mode: RGB/HSV
Color Picker
--------------
h/s/v Edit Value
r/g/b Edit Value
# or x Edit Hex
LMB (x2) Set (Accept) Color
Enter Accept New Color
ESC Cancel
Browse
--------
Wheel / PgUp/Dn Scroll List
LMB View Image
Up/Down / Shift-Wheel View Previous/Next Image
RMB Rename Image
F2 Rename Currently Selected Image
Shift-LMB Duplicate Image
Ctrl-Shift-Alt-LMB Delete Image (permanent!)
Ctrl-Shift-r Reload All Image Files
Ctrl-Up/Down / L/R Previous/Next Directory
Home/End First/Last Image
LMB (folder) Collapse/Expand Folder
Shift-LMB (folder) Create New Image in Folder
Shift-RMB (folder) Export All Images as PNGs
Ctrl-Left/Right Collapse/Expand All Folders
Image
-------
Ctrl-n New (in Base Path)
Ctrl-r Resize
Ctrl-s Save
Ctrl-e Export PNG
Ctrl-t Export TXT (ASCII only, no color)
Ctrl-k Export CSV
Ctrl-a Export ANS (has restrictions, see Appendix D)
Ctrl-m Export XML
Ctrl-p Export XPM
Ctrl-b Export BBCode (ASCII w/fgd color, no bkg)
Ctrl-j Expore C:DDA (see Appendix I)
Resize
--------
LMB / w/h Width/Height
Enter Accept
ESC Cancel
General
---------
Tab Toggle Paint/Browse
F1 / ? Commands
F3 Options
F4 Change Skin
F5 Toggle FPS
Ctrl-F5 Uncap FPS
PrtScn Screenshot
Alt-F4 Exit
Alt-Enter Fullscreen
-----------------------------------------------------------------
Appendix A: Known Issues
-----------------------------------------------------------------
1. Capslock has no affect on text entry. This is because the library is unable to detect key state changes outside the program itself, which would lead to confusion when the capslock effect is out of sync with the key state, thus capslock support was removed completely.
2. Any font change commands (Shift-</> and Ctrl-PgUp/Dn) cannot be repeated without releasing the shift/ctrl key. This is due to an underlying library limitation on command processing when changing the video mode, and workarounds would have other undesirable side effects.
3. When exporting a PNG or taking a screenshot of the application, all foreground colors drawn on non-black background colors will have one or more of their RGB component values shifted by a tiny amount dependent on the background color (never by more than a value of 1, however). This issue is due to how the potential for alpha transparency of foreground colors is handled internally by the library, and cannot be corrected for at this time.
4. If you run REXPaint off a thumb drive, DO NOT remove the drive while the program is running, as file operations will seem to continue working when they are actually quietly failing in the background.
-----------------------------------------------------------------
Appendix B: .xp Format Specification (and Import Libraries)
-----------------------------------------------------------------
If you are making a console/grid-based game with ASCII graphics, such as a traditional roguelike, by importing .xp files directly you will save both development time and huge amounts of space due to the highly compressed format (even smaller than PNGs of the same image/dimensions). This is the original intent behind REXPaint's design: a tool for drawing lots of ASCII art or maps for use in roguelikes.
The .xp files are deflated with zlib (specifically they are gzipped files created via gzofstream); once decompressed the format is binary, and data is stored in the following order (bit size in parenthesis, 32 referring to integers and 8 to unsigned chars):
#-----xp format version (32)
A-----number of layers (32)
/----image width (32)
| image height (32)
| /-ASCII code (32) (little-endian!)
B| | foreground color red (8)
| | foreground color green (8)
| | foreground color blue (8)
| C| background color red (8)
| | background color green (8)
\--\-background color blue (8)
The file begins with the internal .xp format version number, You can ignore this value, as it is only used by REXPaint itself (in case future changes to the format are required). Note that because pre-R9 versions of REXPaint did not include an .xp version number, it's actually stored as a negative value to differentiate old image files (which begin with a positive layer count) in order to detect and automatically update them.
The actual image data begins with A, the number of image layers (always a number from 1 to 9 in the current version), followed by a section B for each layer (the image width/height is stored for every layer due to the method of serialization used, but will always be the same values for every layer). Section C is then repeated for each cell in the image, storing the image's 2D matrix in 1D array format. I.e., the length of that matrix would equal width*height, and if you need them you can get the x-value with "index/height", and y-value with "index%height" (my own matrix class stores its data in a 1D array so I just read all the cells straight in). Note that this means the image data happens to be stored in column-major order!
One thing to remember about directly reading .xp files is that undrawn (empty) cells on any layer (even the base layer) are considered transparent, which is identified by the background color 255,0,255. Thus to rebuild the image as seen in REXPaint, always first test a cell's background color and skip drawing those cells which are transparent, while converting any visible (i.e., non-covered) transparent cells on the lowest layer to black.
If you don't like working with binary, an alternative is to export images to one of the available text-based formats: TXT, CSV, or XML (see Appendix E).
-----------------------------------------------------------------
Appendix C: External Libraries and Tools
-----------------------------------------------------------------
If you'd like to use (or at least reference) some pre-existing code for reading .xp files into your own game/software and converting them to an easy to use format, a number of generous devs have shared their solutions for input/output of REXPaint's native .xp format.
* C#: SadRex by Thraka, a library for importing .xp files
https://github.com/Thraka/SadRex
* C#: RexReader by BaconSoap, the original C# .xp reader (though it has some issues)
https://github.com/BaconSoap/RexReader
* C++: REXReader-C++ by Tim Stoddard, a C++ version of BaconSoap's importer
https://github.com/gamepopper/REXReader-CPlusPlus/
* C++: REXSpeeder by pyridine, a fast xp loader that that also supports resaving
https://github.com/pyridine/REXSpeeder
* C++: mini-REXSpeeder by Mreuwu, a REXSpeeder alternative compatible with emscripten
http://www.gridsagegames.com/forums/index.php?topic=492.0
* C++: RLTK by thebracket, a multifeature roguelike toolkit including xp support
https://github.com/thebracket/rltk
* Clojure: rockpick by Aaron Santos, an .xp import library
https://github.com/aaron-santos/rockpick
* Go: reximage by Ben Nicholls, an .xp image importer
https://github.com/BenNicholls/burl-E/tree/master/reximage
* Godot: rex_sprite by rzuf, an .xp image importer
https://github.com/rzuf79/GDAddons/tree/master/addons/rex_sprite
* Haxe: REXPaintLoaderHaxe by Matt Johnson.
http://lib.haxe.org/p/REXPaintLoaderHaxe/
* Java: xpreader by Stinus Petersen
https://github.com/biscon/xpreader
* Javascript: rex_sprite by chiguireitor, a Node.js module for loading and drawing REXPaint sprites
http://www.gridsagegames.com/blogs/files/rex_sprite.js
* Javascript: glyph-image.js by Dominus-Sicarum,a Node.js module for loading .xp files as an Array of Maps
https://gist.github.com/Dominus-Sicarum/8ed5354e65c36d0910819b1d32087652
* LOVE2D: rexpaint.lua by Vriska Serket, a lightweight REXPaint .xp file reader
https://gist.github.com/vriska-serket/334bfcfa7dfe7265ddbe089e4a51e522
* Nim: rexpaint_nim by Steve Landey, an .xp parser
https://github.com/irskep/rexpaint_nim
* Python: XPLoader by RCIX (includes libtcod support!)
https://github.com/RCIX/XPLoader
* Python 3 + TDL: XPLoaderPy3 by Edern76
https://github.com/Edern76/XPLoaderPy3
* Rust: rs-rexpaint by medusacle, import/export rexpaint ASCII art
https://gitlab.com/medusacle/rs-rexpaint
* SFML 2.0: XPText by Tim Stoddard, an SFML entity for rendering xp images
https://github.com/gamepopper/REXReader-CPlusPlus/
* Swift: REXPaintImage by Steve Johnson, , an .xp reader
https://gist.github.com/irskep/1830b1255c1d73c8dd28da8b83998433
Other tools:
* image2xp: python script to convert an image file to ASCII or .xp (sample output), by mtvee.
https://gist.github.com/mtvee/5629a2caa34dbf3ece95
(sample output: https://i.imgur.com/rAwIWeu.jpg)
* png2rex: utility for converting PNGs to .xp, by thebracket.
https://github.com/thebracket/png2rex
* txt to .xp: C code to convert a txt file to .xp (minus the gzip step), by gumix.
http://www.gridsagegames.com/forums/index.php?topic=416.msg3677#msg3677
* txt2xp: python script to convert a txt file to .xp, by mtvee.
https://gist.github.com/mtvee/d7a4bd450e3cd6766580
* rex2ansi: utility for converting .xp files to 24-bit .ans, by Sludge.
https://github.com/mlabbe/rex2ansi/releases
-----------------------------------------------------------------
Appendix D: ANSI Art (.ans)
-----------------------------------------------------------------
For the ANSI artists out there, REXPaint also supports exporting to .ans.
Creating ANSI art is a little bit different from REXPaint's normal use, so you'll want to follow some basic guidelines:
* Before starting, copy the contents of the data/ansi directory to their respective data folders: copy all files in data/ansi/fonts to data/fonts (overwrite _config.xt when prompted), all files in data/ansi/palettes to data/palettes, and copy REXPaint.cfg to the main directory (overwrite). Copying these files gives you access to the proper palette and an alternate set of more appropriate fonts, but you can always edit _config.xt to make even the square fonts accessible again if preferred.
* Open REXPaint, make your masterpiece, and when done press Ctrl-a to create the .ans file (there is no button for .ans export--it's a "secret" :).
Miscellaneous Notes:
* Separate layers can be used in the editing process, and any that are visible (not hidden) when the .ans is exported will be merged together, so you always get what you see.
* REXPaint does not currently import .ans files, so make sure you keep the .xp files as well for later editing should you need them (.xp files are compressed and extremely tiny, so size certainly won't be an issue).
* ANSI palette colors are identified by their position in the palette, not the actual color. Therefore, you can create any other ANSI palette you like (or modify the existing one), so long as it follows the same positioning: black, red, green, yellow, blue, magenta, cyan, then white (with normal colors in the first row, and bright/bold text colors in the second row). A table of color values for common ANSI palettes on different system can be found on this page: http://en.wikipedia.org/wiki/ANSI_escape_code
* Do NOT use a different palette with an image after it has already been created (without doing a full palette-based color swap) because REXPaint needs to find the image colors in the palette when exporting the .ans file to determine which color type it is. This means that when exporting an .ans file, the same palette used to make the image must be showing.
Further Explanation:
* The alternate cfg file sets the defaultImageWidth value to 80. You can use a different view width (canvasWidth) if you like, but always leave the image width at 80, the value which REXPaint will set in the .ans file. Image height can be resized to anything you want in REXPaint, but leave the view height something reasonable for your screen size.
* It also changes startPalette from "Palette" to "ANSI VGA".
* Most importantly it changes ansiMode to 1, an option only available by editing the cfg manually (i.e. not listed in the options menu). This prevents all but the first 8 colors from being set as the background (a standard ANSI limitation), so if you want to use REXPaint for normal true color painting you'll have to close the program and set this value back to 0. ANSI mode also makes the color picker inaccessible through the brush color, forcing you to use the palette.
-----------------------------------------------------------------
Appendix E: Exportable Text Formats (.txt, .csv., .xml, BBCode)
-----------------------------------------------------------------
Export an image as pure text by pressing Ctrl-t. This will only output the glyphs, thus no color information is stored in the file. By default, TXT export uses UTF8 encoding, but this includes unicode hard space encoding so anyone who wants pure ASCII characters should set txtOutputUTF8=0 in REXPaint.cfg.
While .xp is the ideal format for use in other programs (see Appendix B/C), if you don't want (or are unable) to work with a binary file there are other export options that produce files both human readable and potentially useful in other applications. Naturally all other formats will create files significantly larger than their .xp counterparts, but some users may still prefer or need them for transferring or converting the data. Unlike .xp files, these formats do not store each layer separately, instead merging all visible layers into a single image and storing that.
CSV
-----
The first line stores header information, and all following lines contain the image data in the following format: X,Y,ASCII,Foreground,Background. ASCII values are stored in integer form, and colors are stored as hex values.
XML
-----
All image rows are enclosed in <data></data> tags, each row of image data is enclosed in <row></row> tags, and there will be <height> number of rows, each with <length> number of cell data. Within each row, each cell is enlosed in <cell></cell> tags, and contains <ascii>, <fgd>, and <bkg> tags indicating that cell's ASCII index (stored as an integer, not a character), foreground, and backgroun colors, respectively. Colors are stored as hex values.
XML files are quite bulky due to the amount of markup required.
BBCode
--------
Properly formatted monospaced is output to a text file from where you can copy it to a forum. Mostly a novelty--though I'm sure creative users will find some interesting uses for it.
Unlike pure text output, BBCode retains both the ASCII (stored as unicode) and foreground color. Since most forums do not support background colors, those in the image will be ignored. (I could add it as a configurable option if there's any demand, since some forums do have background color tags.)
For now, if you plan to export BBCode I suggest filling the background with whatever color the forum uses, so you have an idea of what the image will actually look like; that and load up a taller narrow font more like what a website will use (also to have a better perspective). REXPaint's standard version only comes with square fonts, but others can be found on the website's Resources page, or are included in the ANSI version.
Another difference you'll notice when copying BBCode to a forum is that line spacing will cause a divide between each row, which may or may not impact the image's appearance depending on what glyphs are used.
IMPORTANT: Space characters are usually collapsed when entered into a web browser. To avoid this issue and ensure that glyphs are arranged/indented properly in an image, a "hard space" unicode character is used in place of each normal space. Copying the BBCode from the output text file will also copy these hard space characters normally and maintain the image's appearance, but it seems that secondary copying from within a forum itself does *not* retain the proper spacing--it converts them to normal spaces, which will then collapse. The only way around this seems to be always copy the BBCode content from the original source text file. An alternative is to fill unused image space with the "full block" ASCII character (this is easy to do with the fill tool, and can be done before starting to draw). This method can also be used to create makeshift "backgrounds."
-----------------------------------------------------------------
Appendix F: Importing Text Files
-----------------------------------------------------------------
REXPaint normally only edits its native .xp format, but it is also possible to use command line instructions to convert an existing .txt file into an .xp file for editing. While the process is not incredibly convenient since REXPaint wasn't really meant for this purpose, it can be helpful in some situations and was therefore added by request :D.
To convert a .txt file to .xp, simply put it in the /images/ directory and run REXPaint with the command line argument "-txt2xp:XXX", where XXX is the name of the file to convert. The file name as provided can include or exclude the extension (e.g. "image.txt" or just "image"), but the file itself is expected to have a proper .txt extension. The width of the image produced will be determined by the longest line in the .txt file, and by default will use black glyphs on a white background, but once in REXPaint you can easily swap the colors or perform any other normal edits.
Note that only plain text files are supported (glyphs 0~127, no UTF encoding), and if an .xp file of the same name already exists, IT WILL BE OVERWRITTEN!
See also Appendix C for some third-party tools/code also capable of converting .txt files to .xp.
-----------------------------------------------------------------
Appendix G: Importing PNGs
-----------------------------------------------------------------
REXPaint is capable of partially converting .png images to .xp files for editing. This is a special feature developed for my own use in roguelike development, which I've included for the heck of it in case someone else finds it useful. Like .txt imports, it requires use of the command line.
To convert a .png file to .xp, put it in the /images/ directory and run REXPaint with the argument "-png2xp:XXX", where XXX is the name of the file to convert. The file name as provided can include or exclude the .png extension, but the file itself is expected to have a proper .png extension. Moreover, the file name must include "_WWWxHHH" at the end, where WWW and HHH are the pixel width and height of an individual cell in the image. E.g. a Nethack screenshot using an 8x16 monospaced font should be named something like "NetHack_8x16." (This feature was intended to read in images of grid-based terminal output, such as roguelike screenshots.)
While the resulting .xp image will properly assign all foreground and background colors, it cannot actually identify glyphs for what they are. Instead any glyph-containing cell will simply use '?' (in the proper color) to represent a glyph at that location. (Actually identifying glyphs would be a far more complex process requiring OCR etc.) You can also add the "-uniqueGlyphs" switch to the command line, which instead of representing glyphs as '?', will at least distinguish between glyphs within the image that are different from each other and use a unique glyph to represent each one (but the same unique glyph for those that match). Because this was originally developed to as a roguelike screenshot reader, it will also automatically use '.' to represent the most commonly found glyph in the original image.
A wider application of this feature would be for simple pixelwise conversion of any .png image into an .xp file, where each pixel represents the background color for a single cell. In that case, either specify that is the intent by appending _1x1 to the filename (basically "each pixel is a cell"), or simply append nothing and it will be assumed this is the purpose.
It is assumed the .png source has no transparency layer.
-----------------------------------------------------------------
Appendix H: Batch Exporting PNGs
-----------------------------------------------------------------
Simultaneously exporting every .xp image found in the /images/ directory (and its subdirectories) is supported via command line, simply add the "-exportAll" switch when running REXPaint to create a PNG image for each file. The font and character size used for all images is determined by your current REXPaint.cfg settings, and therefore font size is normally limited to those options which REXPaint can normally display on your device, although this restriction can be circumvented by enabling the unlimitedFontSize option described earlier. A summary of the conversion process can be found in the run.log file.
-----------------------------------------------------------------
Appendix I: Exporting ANSI art for C:DDA
-----------------------------------------------------------------
REXPaint can also export art in the format used for the roguelike Cataclysm: Dark Days Ahead (C:DDA). It's a text format somewhat similar to BBCode, but with its own quirks. Use Ctrl-j to export to this format.
For the export to produce a file that can be directly used by C:DDA, it may not have a width greater than 41 characters, thus it is recommended to set your Default Image size to that width in the options menu so that all art starts at that width by default. (No restrictions on height.) Also only C:DDA-compatible colors are exported, and for your convenience there's a premade compatible palette available on the website's Resources page. For the best editing experience, consider using the standard font used by C:DDA, Unifont 8x16, also available on the website's Resources page.
Other references:
* C:DDA Ascii_arts format: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/JSON_INFO.md#ascii_arts
* C:DDA Colors: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/COLOR.md
* C:DDA Art Guide: https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/ASCII_ARTS.md