Skip to content

Commit

Permalink
Cache and color fill bugfixes
Browse files Browse the repository at this point in the history
- Fixed typo in antialiasing cache default keys
- Removed color fill reshape that's no longer necessary and causing
  errors
  • Loading branch information
centuryglass committed Oct 22, 2024
1 parent 519fa3e commit 58e87ef
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 6 additions & 6 deletions resources/config/cache_value_definitions.json
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
"subcategory": "Draw Tool",
"description": "Smooth out jagged edges.",
"type": "bool",
"dafault": true,
"default": true,
"saved": true
},
"eraser_tool_size": {
Expand Down Expand Up @@ -359,7 +359,7 @@
"subcategory": "Eraser Tool",
"description": "Smooth out jagged edges.",
"type": "bool",
"dafault": true,
"default": true,
"saved": true
},
"filter_tool_selected_filter": {
Expand Down Expand Up @@ -455,7 +455,7 @@
"subcategory": "Filter Tool",
"description": "Smooth out jagged edges.",
"type": "bool",
"dafault": true,
"default": true,
"saved": true
},
"smudge_tool_brush_size": {
Expand Down Expand Up @@ -533,7 +533,7 @@
"subcategory": "Smudge Tool",
"description": "Smooth out jagged edges.",
"type": "bool",
"dafault": true,
"default": true,
"saved": true
},
"clone_stamp_tool_brush_size": {
Expand Down Expand Up @@ -611,7 +611,7 @@
"subcategory": "Clone Stamp Tool",
"description": "Smooth out jagged edges.",
"type": "bool",
"dafault": true,
"default": true,
"saved": true
},
"shape_tool_mode": {
Expand Down Expand Up @@ -725,7 +725,7 @@
"subcategory": "Shape Tool",
"description": "Smooth out jagged edges.",
"type": "bool",
"dafault": true,
"default": true,
"saved": true
},
"saved_main_window_pos": {
Expand Down
2 changes: 1 addition & 1 deletion src/util/visual/image_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ def color_fill(image: QImage, color: QColor, threshold: float) -> QImage:
un_multiplied_image = image.convertToFormat(QImage.Format.Format_ARGB32)
np_image = image_data_as_numpy_8bit(un_multiplied_image)
color = [ color.blue(), color.green(), color.red(), color.alpha()]
np_color = np.array(color, dtype=np_image.dtype).reshape(1, 1, 4)
np_color = np.array(color, dtype=np_image.dtype)

# Create a 4-channel difference image for comparison
diff_image = np.zeros_like(np_image)
Expand Down
6 changes: 6 additions & 0 deletions test/resources/cache_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
"draw_tool_pressure_opacity": false,
"draw_tool_pressure_hardness": false,
"draw_tool_brush_pattern": "Solid",
"draw_tool_antialias": false,
"eraser_tool_size": {
"min": 1,
"max": 300,
Expand All @@ -77,6 +78,7 @@
"eraser_tool_pressure_size": true,
"eraser_tool_pressure_opacity": false,
"eraser_tool_pressure_hardness": false,
"eraser_tool_antialias": false,
"filter_tool_selected_filter": "RGBA Color Balance",
"filter_tool_cached_parameters": "{\"Blur\": [\"Box\", 3.0], \"Brightness/Contrast\": [1.0, 1.0], \"Posterize\": [3], \"RGBA Color Balance\": [1.0, 1.0, 1.0, 1.0], \"Sharpen\": [2.0]}",
"filter_tool_brush_size": {
Expand All @@ -100,6 +102,7 @@
"filter_tool_pressure_size": true,
"filter_tool_pressure_opacity": false,
"filter_tool_pressure_hardness": false,
"filter_tool_antialias": false,
"smudge_tool_brush_size": {
"min": 1,
"max": 300,
Expand All @@ -121,6 +124,7 @@
"smudge_tool_pressure_size": true,
"smudge_tool_pressure_opacity": false,
"smudge_tool_pressure_hardness": false,
"smudge_tool_antialias": false,
"clone_stamp_tool_brush_size": {
"min": 1,
"max": 300,
Expand All @@ -142,6 +146,7 @@
"clone_stamp_tool_pressure_size": true,
"clone_stamp_tool_pressure_opacity": false,
"clone_stamp_tool_pressure_hardness": false,
"clone_stamp_tool_antialias": false,
"shape_tool_mode": "",
"shape_tool_vertex_count": {
"min": 3,
Expand All @@ -167,6 +172,7 @@
},
"shape_tool_fill_pattern": "",
"shape_tool_fill_color": "#FFFFFFFF",
"shape_tool_antialias": false,
"saved_main_window_pos": "1,28,800,600",
"saved_layer_window_pos": "",
"saved_navigation_window_pos": "",
Expand Down

0 comments on commit 58e87ef

Please sign in to comment.