Bug 453129 - Painting very thin lines will become dashed.
Summary: Painting very thin lines will become dashed.
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Brush engines (show other bugs)
Version: 5.0.6
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: tomtomtomreportingin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-28 10:02 UTC by Eranthis stellata Maxim
Modified: 2023-05-09 08:57 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Draw with a 4px size brush to see the left side (enlarge 800% for easy observation). (3.69 KB, image/png)
2022-04-28 10:02 UTC, Eranthis stellata Maxim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Eranthis stellata Maxim 2022-04-28 10:02:20 UTC
Created attachment 148426 [details]
Draw with a 4px size brush to see the left side (enlarge 800% for easy observation).

SUMMARY
Painting very thin lines will become dashed.
Under normal circumstances, no line, no matter how thin, should become dashed.
But if the brush is too small, say 0.2px, then a dashed line will be drawn, whether with a mouse or a pen.
This results in very thin lines becoming dashed when the lines are lightly drawn with the pen.
Without zooming in, or the brush size itself is large, it will be hard to notice.

STEPS TO REPRODUCE
1. Set the Basic-5 Size to 0.2px.
2. Draw a line.

OBSERVED RESULT
Lines become dashed.

EXPECTED RESULT
Lines are normal.

SOFTWARE/OS VERSIONS
Krita

 Version: 5.0.6
 Installation type: installer / portable package
 Languages: zh_CN, zh, en_US, en
 Hidpi: true

Qt

  Version (compiled): 5.12.12
  Version (loaded): 5.12.12

OS Information

  Build ABI: x86_64-little_endian-llp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: winnt
  Kernel Version: 10.0.19042
  Pretty Productname: Windows 10 (10.0)
  Product Type: windows
  Product Version: 10

OpenGL Info
 
  Vendor:  "Google Inc." 
  Renderer:  "ANGLE (NVIDIA GeForce GTX 970 Direct3D11 vs_5_0 ps_5_0)" 
  Version:  "OpenGL ES 3.0 (ANGLE 2.1.0.57ea533f79a7)" 
  Shading language:  "OpenGL ES GLSL ES 3.00 (ANGLE 2.1.0.57ea533f79a7)" 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
  Current format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::DefaultSwapBehavior, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::NoProfile) 
     Version: 3.0
     Supports deprecated functions false 
     is OpenGL ES: true 
  supportsBufferMapping: true 
  supportsBufferInvalidation: false 
  Extensions: 
     "GL_EXT_map_buffer_range" 
     "GL_ANGLE_texture_usage" 
     "GL_EXT_texture_compression_s3tc_srgb" 
     "GL_CHROMIUM_copy_compressed_texture" 
     "GL_ANGLE_program_cache_control" 
     "GL_EXT_occlusion_query_boolean" 
     "GL_OES_texture_float" 
     "GL_NV_EGL_stream_consumer_external" 
     "GL_OES_EGL_image_external_essl3" 
     "" 
     "GL_OES_texture_half_float" 
     "GL_ANGLE_request_extension" 
     "GL_EXT_color_buffer_float" 
     "GL_EXT_draw_buffers" 
     "GL_OES_element_index_uint" 
     "GL_NV_fence" 
     "GL_ANGLE_pack_reverse_row_order" 
     "GL_KHR_debug" 
     "GL_EXT_texture_storage" 
     "GL_OES_texture_half_float_linear" 
     "GL_ANGLE_depth_texture" 
     "GL_OES_packed_depth_stencil" 
     "GL_CHROMIUM_copy_texture" 
     "GL_NV_pack_subimage" 
     "GL_EXT_texture_filter_anisotropic" 
     "GL_ANGLE_client_arrays" 
     "GL_ANGLE_translated_shader_source" 
     "GL_EXT_texture_format_BGRA8888" 
     "GL_EXT_texture_rg" 
     "GL_ANGLE_framebuffer_blit" 
     "GL_OES_mapbuffer" 
     "GL_OES_standard_derivatives" 
     "GL_OES_compressed_ETC1_RGB8_texture" 
     "GL_EXT_frag_depth" 
     "GL_OES_get_program_binary" 
     "GL_CHROMIUM_bind_uniform_location" 
     "GL_ANGLE_multiview" 
     "GL_EXT_unpack_subimage" 
     "GL_CHROMIUM_color_buffer_float_rgb" 
     "GL_OES_depth32" 
     "GL_ANGLE_texture_compression_dxt5" 
     "GL_ANGLE_framebuffer_multisample" 
     "GL_ANGLE_robust_client_memory" 
     "GL_CHROMIUM_sync_query" 
     "GL_EXT_blend_minmax" 
     "GL_OES_rgb8_rgba8" 
     "GL_ANGLE_lossy_etc_decode" 
     "GL_CHROMIUM_bind_generates_resource" 
     "GL_EXT_read_format_bgra" 
     "GL_OES_vertex_array_object" 
     "GL_EXT_discard_framebuffer" 
     "GL_OES_EGL_image" 
     "GL_EXT_color_buffer_half_float" 
     "GL_EXT_disjoint_timer_query" 
     "GL_EXT_shader_texture_lod" 
     "GL_EXT_robustness" 
     "GL_ANGLE_texture_compression_dxt3" 
     "GL_EXT_texture_norm16" 
     "GL_ANGLE_instanced_arrays" 
     "GL_OES_texture_float_linear" 
     "GL_OES_texture_npot" 
     "GL_EXT_texture_compression_dxt1" 
     "GL_OES_surfaceless_context" 
     "GL_EXT_sRGB" 
     "GL_NV_pixel_buffer_object" 
     "GL_CHROMIUM_color_buffer_float_rgba" 
     "GL_EXT_debug_marker" 
     "GL_OES_EGL_image_external" 

QPA OpenGL Detection Info 
  supportsDesktopGL: true 
  supportsAngleD3D11: true 
  isQtPreferAngle: true 

useBufferInvalidation (config option): false


Hardware Information

  GPU Acceleration: auto
  Memory: 32693 Mb
  Number of Cores: 16
  Swap Location: C:/Users/xi/AppData/Local/Temp

Current Settings

  Current Swap Location: C:/Users/xi/AppData/Local/Temp
  Current Swap Location writable: true
  Undo Enabled: true
  Undo Stack Limit: 200
  Use OpenGL: true
  Use OpenGL Texture Buffer: true
  Disable Vector Optimizations: false
  Disable AVX Optimizations: false
  Canvas State: OPENGL_NOT_TRIED
  Autosave Interval: 420
  Use Backup Files: true
  Number of Backups Kept: 1
  Backup File Suffix: ~
  Backup Location: Same Folder as the File
  Backup Location writable: false
  Use Win8 Pointer Input: false
  Use RightMiddleTabletButton Workaround: false
  Levels of Detail Enabled: false
  Use Zip64: false


Display Information
Number of screens: 2
	Screen: 0
		Name: \\.\DISPLAY1
		Depth: 32
		Scale: 1
		Resolution in pixels: 2560x1440
		Manufacturer: 
		Model: 
		Refresh Rate: 59
	Screen: 1
		Name: \\.\DISPLAY2
		Depth: 32
		Scale: 1
		Resolution in pixels: 1920x1080
		Manufacturer: 
		Model: 
		Refresh Rate: 60


---------------------
================================================================================
SESSION: 28 Apr 2022 17:41:28 +0800. Executing C:\Program Files\Krita (x64)\bin\krita.exe

Krita Version: 5.0.6, Qt version compiled: 5.12.12, loaded: 5.12.12. Process ID: 7996
-- -- -- -- -- -- -- --
28 Apr 2022 17:41:28 +0800: Style: fusion. Available styles: windowsvista, Windows, Fusion
28 Apr 2022 17:41:32 +0800: Creating database from scratch (database didn't exist, new schema version: 0.0.16).
28 Apr 2022 17:41:46 +0800: Non-store package - creating updater
28 Apr 2022 17:42:00 +0800: Created image "未命名", 2480 * 3508 pixels, 300 dpi. Color model: 8 位整数/通道 RGB/透明度 (sRGB-elle-V2-srgbtrc.icc). Layers: 2
28 Apr 2022 17:49:00 +0800: Autosaving: C:/Users/xi/AppData/Local/Temp/krita-7996-document_0-autosave.kra
28 Apr 2022 17:49:00 +0800: Converting from application/x-krita to application/x-krita. Location: C:/Users/xi/AppData/Local/Temp/krita-7996-document_0-autosave.kra. Real location: C:/Users/xi/AppData/Local/Temp/krita-7996-document_0-autosave.kra. Batchmode: 0. Configuration: none
28 Apr 2022 17:49:01 +0800: Completed saving C:/Users/xi/AppData/Local/Temp/krita-7996-document_0-autosave.kra (mime: application/x-krita). Result: OK. Warning: . Size: 29345

---------------------
Comment 1 Eranthis stellata Maxim 2022-04-28 10:23:58 UTC
I tested 5.1.0-prealpha (git e53f968), still the same.
"Activate brush supersampling for all auto brushes smaller than 10 px"
This fix works, but doesn't fix the bug where very thin lines (like 0.2px) become dashed. (Like the bug reported here.)
Comment 2 tomtomtomreportingin 2022-11-01 19:26:48 UTC
Well, I can at least confirm this.

It may be solvable by doubling the supersampling factor, at least when the brush size is 1-2 px and below, but I'm not sure about what side effects that may have.
Comment 3 Bug Janitor Service 2023-04-23 01:31:12 UTC
A possibly relevant merge request was started @ https://invent.kde.org/graphics/krita/-/merge_requests/1788
Comment 4 Dmitry Kazakov 2023-05-09 08:57:14 UTC
Git commit 4130e84fc5ede6bd6f9105b4d06f0830ba3de994 by Dmitry Kazakov, on behalf of Tom Tom Tom.
Committed on 09/05/2023 at 08:56.
Pushed by dkazakov into branch 'master'.

Double supersampling factor when brush size is lower than 1 px

Increasing supersampling factor from 3 to 6 smooths out the dashed effect of sub-1px strokes to almost invisible levels.

M  +5    -0    libs/image/kis_base_mask_generator.cpp
M  +2    -0    libs/image/kis_base_mask_generator.h
M  +5    -4    libs/image/kis_brush_mask_scalar_applicator.h

https://invent.kde.org/graphics/krita/commit/4130e84fc5ede6bd6f9105b4d06f0830ba3de994