normcap
normcap copied to clipboard
Blank screen on Arch
I run archlinux kde and upon launching normcap I only see this:
It seems to be inline with issue 126 over on giters, although it wasn't fixed for me by enabling the compositor (it was never off), and I know that I can have transparent windows, asl GLava works fine.
Here's my logs:
normcap -V
15:20:08 - INFO - normcap.app - L:41 - Start NormCap v0.2.8
15:20:08 - DEBUG - normcap.app - L:42 - CLI command: /usr/bin/normcap -V
15:20:08 - DEBUG - normcap.app - L:43 - QT LibraryPaths: ['/usr/lib/qt/plugins']
QSslSocket: OpenSSL 1.1.1l 24 Aug 2021 True
15:20:08 - INFO - normcap.utils - L:150 - Copy 0 traineddata files to config directory
15:20:08 - DEBUG - normcap.app - L:65 - System info:
{ 'config_directory': PosixPath('/home/felix/.config/normcap'),
'desktop_environment': <DesktopEnvironment.KDE: 2>,
'display_manager': <DisplayManager.X11: 2>,
'is_briefcase_package': False,
'normcap_version': '0.2.8',
'platform': 'linux',
'pyside2_version': '5.15.2',
'qt_version': '5.15.2',
'screens': { 0: ScreenInfo(is_primary=True, device_pixel_ratio=1.0, geometry=Rect(left=1920, top=0, right=3840, bottom=1080), index=0),
1: ScreenInfo(is_primary=False, device_pixel_ratio=1.0, geometry=Rect(left=0, top=0, right=1920, bottom=1080), index=1),
2: ScreenInfo(is_primary=False, device_pixel_ratio=1.0, geometry=Rect(left=3840, top=0, right=4890, bottom=1680), index=2)},
'tessdata_path': '/usr/share/tessdata/',
'tesseract_languages': ['eng', 'osd'],
'tesseract_version': '4.1.1'}
15:20:08 - DEBUG - normcap.base_window - L:49 - Create window for screen 0
15:20:08 - DEBUG - normcap.base_window - L:248 - Set window for screen 0 to fullscreen
15:20:08 - DEBUG - normcap.system_tray - L:21 - Set up tray icon
15:20:08 - DEBUG - normcap.base_window - L:49 - Create window for screen 1
15:20:08 - DEBUG - normcap.base_window - L:248 - Set window for screen 1 to fullscreen
15:20:08 - DEBUG - normcap.base_window - L:49 - Create window for screen 2
15:20:08 - DEBUG - normcap.base_window - L:248 - Set window for screen 2 to fullscreen
15:20:09 - DEBUG - normcap.main_window - L:179 - Hide 3 window(s)
15:20:10 - INFO - normcap.main_window - L:272 - Take screenshot of position (2174, 171, 3197, 885)
15:20:10 - DEBUG - normcap.screengrab - L:32 - Grab screen: ScreenInfo(is_primary=True, device_pixel_ratio=1.0, geometry=Rect(left=1920, top=0, right=3840, bottom=1080), index=0)
15:20:10 - DEBUG - normcap.screengrab - L:73 - Use capture method: QT by screen
15:20:10 - DEBUG - normcap.utils - L:32 - Store debug image in: /tmp/normcap/2021-11-30_15-20-10_009850_raw_qt.png
15:20:10 - DEBUG - normcap.screengrab - L:106 - Screen scale factor: 1.0
15:20:10 - DEBUG - normcap.screengrab - L:107 - Image devicePixelRatio: 1.0
15:20:10 - DEBUG - normcap.screengrab - L:110 - Image crop box rect: (254, 171, 1023, 714)
15:20:10 - DEBUG - normcap.utils - L:32 - Store debug image in: /tmp/normcap/2021-11-30_15-20-10_086670_cropped.png
15:20:10 - DEBUG - normcap.main_window - L:281 - Prepare image for OCR
15:20:10 - INFO - normcap.enhance - L:17 - Apply enhancements to image
15:20:10 - DEBUG - normcap.enhance - L:92 - Resize screenshot by factor 3.2
15:20:10 - DEBUG - normcap.utils - L:32 - Store debug image in: /tmp/normcap/2021-11-30_15-20-10_111800_enlarged.png
15:20:10 - DEBUG - normcap.utils - L:32 - Store debug image in: /tmp/normcap/2021-11-30_15-20-10_334464_padded.png
15:20:10 - DEBUG - normcap.main_window - L:290 - Perform OCR
15:20:10 - DEBUG - normcap.ocr - L:62 - Init tesseract with args: {'path': '/usr/share/tessdata/', 'lang': 'eng', 'oem': 1, 'psm': 1}
15:20:11 - INFO - normcap.ocr - L:85 - PSM Mode: 1, OSM Mode: 1, Mean Conf: 13.00
15:20:11 - INFO - normcap.main_window - L:295 - Raw text from OCR:
[= —— — ——————————————————————— ——————————— ————————— —————————————————— ——————————————————
15:20:11 - DEBUG - normcap.main_window - L:296 - Result from OCR:
best_magic:
image: <PySide2.QtGui.QImage(QSize(3433, 2444),format=QImage::Format_RGB32,depth=32,devicePixelRatio=1,bytesPerLine=13732,sizeInBytes=33561008) at 0x7f755bb5cfc0>
image_area: 8390252
image_size: (3433, 2444)
lines: [= —— — ——————————————————————— ——————————— ————————— —————————————————— ——————————————————
mean_conf: 14.625
mode: 1
num_blocks: 1
num_lines: 1
num_pars: 1
psm_opt: 1
rect: Rect(left=2174, top=171, right=3197, bottom=885)
scale_factor: 1.0
scores: {}
screen: ScreenInfo(is_primary=True, device_pixel_ratio=1.0, geometry=Rect(left=1920, top=0, right=3840, bottom=1080), index=0)
text: [= —— — ——————————————————————— ——————————— ————————— —————————————————— ——————————————————
transformed:
words:
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:1 | left:134 | top:102 | width:36 | height:34 | conf:4 | text:[=
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:2 | left:175 | top:115 | width:70 | height:7 | conf:16 | text:——
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:3 | left:259 | top:115 | width:63 | height:7 | conf:0 | text: —
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:4 | left:329 | top:115 | width:3024 | height:7 | conf:0 | text:———————————————————————
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:5 | left:1205 | top:102 | width:423 | height:34 | conf:27 | text:———————————
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:6 | left:1627 | top:102 | width:347 | height:34 | conf:24 | text:—————————
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:7 | left:1973 | top:102 | width:692 | height:34 | conf:33 | text:——————————————————
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:8 | left:2664 | top:102 | width:692 | height:34 | conf:13 | text:——————————————————
15:20:11 - DEBUG - normcap.main_window - L:302 - Apply Magics
15:20:11 - INFO - normcap.email_magic - L:33 - 0 emails found ['']
15:20:11 - DEBUG - normcap.email_magic - L:44 - 0/91 chars in emails. Ratio: 0.0)
15:20:11 - INFO - normcap.url_magic - L:52 - 0 URLs found ['']
15:20:11 - DEBUG - normcap.url_magic - L:62 - 0 of 91 chars in emails (ratio: 0.0)
15:20:11 - DEBUG - normcap.magic - L:70 - All scores: {'SingleLineMagic': 50, 'MultiLineMagic': 0, 'ParagraphMagic': 0.0, 'EmailMagic': 0.0, 'UrlMagic': 0.0}
15:20:11 - INFO - normcap.magic - L:87 - Highest scored magic: SingleLineMagic (50)
15:20:11 - DEBUG - normcap.main_window - L:304 - Result from applying Magics:
best_magic: SingleLineMagic
image: <PySide2.QtGui.QImage(QSize(3433, 2444),format=QImage::Format_RGB32,depth=32,devicePixelRatio=1,bytesPerLine=13732,sizeInBytes=33561008) at 0x7f755bb5cfc0>
image_area: 8390252
image_size: (3433, 2444)
lines: [= —— — ——————————————————————— ——————————— ————————— —————————————————— ——————————————————
mean_conf: 14.625
mode: 1
num_blocks: 1
num_lines: 1
num_pars: 1
psm_opt: 1
rect: Rect(left=2174, top=171, right=3197, bottom=885)
scale_factor: 1.0
scores: {'SingleLineMagic': 50, 'MultiLineMagic': 0, 'ParagraphMagic': 0.0, 'EmailMagic': 0.0, 'UrlMagic': 0.0}
screen: ScreenInfo(is_primary=True, device_pixel_ratio=1.0, geometry=Rect(left=1920, top=0, right=3840, bottom=1080), index=0)
text: [= —— — ——————————————————————— ——————————— ————————— —————————————————— ——————————————————
transformed: [= —— — ——————————————————————— ——————————— ————————— —————————————————— ——————————————————
words:
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:1 | left:134 | top:102 | width:36 | height:34 | conf:4 | text:[=
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:2 | left:175 | top:115 | width:70 | height:7 | conf:16 | text:——
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:3 | left:259 | top:115 | width:63 | height:7 | conf:0 | text: —
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:4 | left:329 | top:115 | width:3024 | height:7 | conf:0 | text:———————————————————————
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:5 | left:1205 | top:102 | width:423 | height:34 | conf:27 | text:———————————
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:6 | left:1627 | top:102 | width:347 | height:34 | conf:24 | text:—————————
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:7 | left:1973 | top:102 | width:692 | height:34 | conf:33 | text:——————————————————
level:5 | page_num:1 | block_num:1 | par_num:1 | line_num:1 | word_num:8 | left:2664 | top:102 | width:692 | height:34 | conf:13 | text:——————————————————
15:20:11 - DEBUG - normcap.clipboard - L:15 - Copy to clipboard:
[= —— — ——————————————————————— ——————————— ————————— —————————————————— ——————————————————
15:20:11 - DEBUG - normcap.notifier - L:29 - Send notification
15:20:11 - DEBUG - normcap.main_window - L:207 - Path to debug images: /tmp/normcap
15:20:11 - INFO - normcap.main_window - L:208 - Exit normcap (reason: notification sent)
Hi @fischer-felix, yes, that indeed looks like a transparency issue that sometimes appears together with Plasma (KDE). I'm not too familiar with KDE, but it seems like window transparency depends on compositor and the theme in use, as that has to support transparency, too.
Could you please try with a different theme?
If that doesn't help, I'll have to replicate this by myself, which will not be easy, as I'm not very familiar with Arch or KDE... :see_no_evil:
Related issues: #126, #155
I'm having a similar issue in Debian 11, using Awesome as my "desktop". Is there a particular compositor that is known to function well with Awesome for NormCap?
@Lonniebiz, unfortunately I have no experience with Awesome.
Same issue on Manjaro with i3 (without compositor, 3 monitors, 2 are mirrored).
Edit: Seeing it might be an issue with missing compositor, transparency in Flameshot works (very similar app, also asks for a rectangle input on a black partially transparent overlay).
Hi @mnn, hi @Lonniebiz , this issue was addressed in the latest pre-release NormCap v0.3.0-beta.
Would you mind help testing v0.3.0-beta and report back, if it solves this issue? Thanks!
It looks good, no more black screen :+1:. Second monitor is a bit shrunk (I guess the overlay on a second monitor doesn't cover whole screen, but a "screenshot" of a whole screen is used and then downsized to a maximal window size, so it doesn't cover bottom and top bar from i3), but it doesn't seem to negatively impact functionality (it's downsized, not cropped).
Text recognition works. I am not sure if it supposed to do so, but when I selected rectangle above
Intended only for developing purposes! You're better off using the latest v0.* build instead!
Please report your experience in the discussions
I got in a clipboard only the first line (in both parse and raw modes).
@dynobo When I originally reported my issue of NormCap not working with Awesome, I was using the NormCap 0.2.10 AppImage. Today, I tried again using the AppImage of version 0.3.6.2.548021370, and NormCap now works in Awesome!
I've very happy about this. You see, NormCap is my favorite new program, and I've been missing it dearly. Seriously, it is the best thing I've come across in years. Thank you so much for providing NormCap via AppImage. I love AppImage too because of its portability when compared to alternatives like Snap or Flatpak.