Skip to content
This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Commit 25fa85f

Browse files
committed
Major release [v2.0.0.0]
- Greatly improved the efficiency of the drawing and color matching algorithms - New UI Look - UI shows more info - Fixed tab indexes - Added option to change which algorithm is used - Saving a new preset doesn't clear it from memory - Minor bug fixes
1 parent d38a967 commit 25fa85f

File tree

6 files changed

+55
-54
lines changed

6 files changed

+55
-54
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<img src="assets/images/banner.png">
22

3-
### **This program is still in very early-development, please report any bugs you find in the issues tab! I would also appreciate any feedback you have.**
4-
5-
<br>
6-
7-
# [<b>>> Download Latest</b>](https://github.com/o7q/DrawBot/releases/download/v1.0.0.0/DrawBot.exe)
3+
# [<b>>> Download Latest</b>]()
84
### Welcome! DrawBot is a simple, versatile drawing robot that works in nearly every game and program. (ex. Gartic Phone, Skribbl, Jackbox, Paint, etc.)
95

106
---
@@ -40,8 +36,8 @@ While drawing, you can push the **ESCAPE** key to abort the drawing process.
4036
<summary><b>Step 2.</b> Define bounds</summary>
4137

4238

43-
- **2.1** Click the **P1 Button** and then click on the **top-left** of your canvas where the image will be drawn, this will define the first point
44-
- **2.2** Click the **P2 Button** and then click on the **bottom-right** of your canvas where the image will be drawn, this will define the second point
39+
- **2.1** Click the **A Button** and then click on the **top-left** of your canvas where the image will be drawn, this will define the first point
40+
- **2.2** Click the **B Button** and then click on the **bottom-right** of your canvas where the image will be drawn, this will define the second point
4541

4642
</details>
4743

@@ -63,11 +59,12 @@ While drawing, you can push the **ESCAPE** key to abort the drawing process.
6359
<summary><b>Step 4.</b> Drawing</summary>
6460

6561
- **4.1** Determine the draw settings with the **Quality** and **Speed** sliders. Quality will increase the pixel density at the cost of slowness. Speed will increase speed, speeds too high can cause issues on some programs/games
66-
- **4.2** Click the **Draw Button** to start! **Remember:** You can push the **ESCAPE** key to abort the drawing process.
62+
- **4.2** Select the draw method (info about these are at the bottom of the interface dictionary)
63+
- **4.3** Click the **Draw Button** to start! **Remember:** You can push the **ESCAPE** key to abort the drawing process.
6764

6865
</details>
6966

70-
*Video tutorial coming soon*
67+
*Video tutorial coming, maybe.*
7168

7269
<br>
7370

@@ -76,11 +73,11 @@ While drawing, you can push the **ESCAPE** key to abort the drawing process.
7673
- **Select Image Button** Opens a file dialog to select a local image
7774
- **URL Image Textbox** Uses a URL from the internet instead of a local image (URL image is prioritized, ensure it is blank if you are using a local image)
7875
- **Bounding Box Configuration**
79-
- **P1 Button** (Point-1) Select the top-left point of the drawing area
80-
- **P2 Button** (Point-2) Select the bottom-right point of the drawing area
76+
- **A Button** (Point-1) Select the top-left point of the drawing area
77+
- **B Button** (Point-2) Select the bottom-right point of the drawing area
8178
- Preset Creator
82-
- **Add Color Button** Adds a new color to the usable colors in the preset (it does not matter which order you put them in)
83-
- **Reset Button** Clears the entire preset process
79+
- **+ Button** Adds a new color to the usable colors in the preset (it does not matter which order you put them in)
80+
- **x Button** Removes the last added color
8481
- **Preset Name Textbox** Name for the preset
8582
- **Save Button** Save the preset to a file so it can be loaded later
8683
- Preset Loader
@@ -90,7 +87,10 @@ While drawing, you can push the **ESCAPE** key to abort the drawing process.
9087
- Quality/Speed Controllers
9188
- **Quality Slider** Change the pixel density of the image (higher looks better but is slower)
9289
- **Speed Slider** Change the speed of the drawing process (if set too high it can cause issues in some programs)
93-
- **Draw Button** Draws the selected image with select configuration
90+
- Draw Methods
91+
- **Strips (quality)** A method that draws row by row, this method guarantees quality
92+
- **Blobs (fast)** A method that draws by drawing colors in groups, this method guarantees speed
93+
- **Draw Button** Draws the selected image with current settings
9494

9595
---
9696

assets/images/program.png

26.9 KB
Loading

changelog.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
~
1+
~ v2.0.0.0
22
- Greatly improved the efficiency of the drawing and color matching algorithms
3-
- Improved UI
4-
- Adding option to change which algorithm is used
5-
- Now shows what preset you have loaded
6-
- Now when you save a new preset doesn't clear memory right away
7-
- Fixed tab indexes
3+
- New UI Look
4+
- UI shows more info
5+
- Fixed tab indexes
6+
- Added option to change which algorithm is used
7+
- Saving a new preset doesn't clear it from memory
88
- Minor bug fixes

src/DrawBot/program.Designer.cs

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/DrawBot/program.cs

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -202,28 +202,28 @@ private int drawUsingStrips(int x_bound, int y_bound, int quality_step, double s
202202
Color color = getColor(image, x_track, y_track);
203203

204204
// color matching algorithm (thank you emmett!)
205-
int closestIndex = -1;
206-
int closestIndexNext = -1;
207-
int closestDist = Int32.MaxValue;
208-
int closestDistNext = Int32.MaxValue;
205+
int nearestIndex = -1;
206+
int nearestIndexNext = -1;
207+
int nearestDist = Int32.MaxValue;
208+
int nearestDistNext = Int32.MaxValue;
209209
for (int j = 0; j < paletteAmount; j++)
210210
{
211211
// calculate distance to color
212212
int dist = getDist(color.R, colorPalette[j, 2], color.G, colorPalette[j, 3], color.B, colorPalette[j, 4]);
213213
int distNext = getDist(colorNext.R, colorPalette[j, 2], colorNext.G, colorPalette[j, 3], colorNext.B, colorPalette[j, 4]);
214214

215-
// update closest color
216-
if (dist < closestDist)
215+
// update nearest color
216+
if (dist < nearestDist)
217217
{
218-
closestDist = dist;
219-
closestIndex = j;
218+
nearestDist = dist;
219+
nearestIndex = j;
220220
}
221221

222-
// update future closest color
223-
if (distNext < closestDistNext)
222+
// update future nearest color
223+
if (distNext < nearestDistNext)
224224
{
225-
closestDistNext = distNext;
226-
closestIndexNext = j;
225+
nearestDistNext = distNext;
226+
nearestIndexNext = j;
227227
}
228228
}
229229

@@ -233,33 +233,32 @@ private int drawUsingStrips(int x_bound, int y_bound, int quality_step, double s
233233
// select first needed color
234234
if (initialSelect == true)
235235
{
236-
moveCursor(colorPalette[closestIndex, 0], colorPalette[closestIndex, 1]);
236+
moveCursor(colorPalette[nearestIndex, 0], colorPalette[nearestIndex, 1]);
237237
clickCursor(speed);
238238

239239
moveCursor(x_track_temp, y_track_temp);
240240

241241
initialSelect = false;
242242
}
243243

244-
if (closestIndex == closestIndexNext)
244+
if (nearestIndex == nearestIndexNext)
245245
{
246246
// place pixel using same color
247247
if (selectNew == true)
248248
{
249-
moveCursor(colorPalette[closestIndex, 0], colorPalette[closestIndex, 1]);
249+
moveCursor(colorPalette[nearestIndex, 0], colorPalette[nearestIndex, 1]);
250250
clickCursor(speed);
251251

252252
moveCursor(x_track_temp, y_track_temp);
253253
}
254-
255254
selectNew = false;
256255

257256
clickCursor(speed);
258257
}
259258
else
260259
{
261260
// place pixel using new color
262-
moveCursor(colorPalette[closestIndex, 0], colorPalette[closestIndex, 1]);
261+
moveCursor(colorPalette[nearestIndex, 0], colorPalette[nearestIndex, 1]);
263262
clickCursor(speed);
264263

265264
moveCursor(x_track_temp, y_track_temp);
@@ -440,11 +439,10 @@ private void registerColorButton_Click(object sender, EventArgs e)
440439
{
441440
if (hasSavedPalette == true)
442441
{
443-
finalizeColorsBox.Text = "";
444442
colorsTemp = "";
445443
colorsIndex = 0;
446-
colorIndexLabel.Text = "Color 0";
447-
colorLabel.Text = "(0, 0, 0)";
444+
colorIndexLabel.Text = "Color 0"; colorIndexLabel.Refresh();
445+
colorLabel.Text = "(0, 0, 0)"; colorLabel.Refresh();
448446
colorSquare.BackColor = Color.FromArgb(255, 0, 0, 0);
449447

450448
hasSavedPalette = false;
@@ -484,6 +482,7 @@ private void finalizeColorsButton_Click(object sender, EventArgs e)
484482
File.WriteAllText("DrawBot\\presets\\" + name + ".palette", colorsTemp);
485483
refreshColorsList();
486484

485+
finalizeColorsBox.Text = "";
487486
hasSavedPalette = true;
488487
}
489488

to-do.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
- Feature to preserve settings when the program is closed
12
- Option to add region of colors
23
- Option to preserve aspect ratio
3-
- Display which colors the user has already clicked on
4+
- Display which colors the user has already clicked on
5+
- Add tooltips

0 commit comments

Comments
 (0)