[Python Tool] Screengrabber for Linux / Windows / OS-X (probably)

Post Reply
User avatar
F1RMB
Posts: 2708
Joined: Sat Nov 16, 2019 5:42 am
Location: Grenoble, France

[Python Tool] Screengrabber for Linux / Windows / OS-X (probably)

Post by F1RMB » Sat Dec 07, 2019 10:18 pm

Hi,

Here is a small python script to save screen capture to png file. It supports few parameters:

Code: Select all

Usage:
       gd-77_screen_grabber.py [OPTION]

    -h, --help                     : Display this help text
    -d, --device=<COM port>        : Use the specified device as serial port
    -s, --scale=v                  : Apply scale factor (1..x)
    -o, --output=<filename>        : Save the image in <filename>.png
    -f, --foreground=#RRGGBB       : Use specified color as foreground pixel color
    -b, --background=#RRGGBB       : Use specified color as background color
It works with python-2 and python-3. You need python-serial module.

Cheers.
---
Daniel

.
Attachments
gd-77_screen_grabber.py.zip
(3.04 KiB) Downloaded 148 times
Last edited by F1RMB on Mon Dec 09, 2019 3:03 pm, edited 4 times in total.

VK3KYY
Posts: 7605
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: [Python Tool] Screengrabber for Linux

Post by VK3KYY » Sat Dec 07, 2019 10:44 pm

Cool

BTW.

I've been discussing with Rafa EA3BIL to change the CPS to set the background colour to the same colour he uses in his diagrams and also rescale to 200% ( probably by pixel replication )

However, I've not had time to do this yet.

User avatar
F1RMB
Posts: 2708
Joined: Sat Nov 16, 2019 5:42 am
Location: Grenoble, France

Re: [Python Tool] Screengrabber for Linux

Post by F1RMB » Sat Dec 07, 2019 10:48 pm

Hi Roger,

I can take a look at this, but tomorrow, it's pretty late here ;-)

I will also make the modifications to this script about default background color and default scale factor.

Cheers.
---
Daniel

PS: but I still do hate python :D

VK3KYY
Posts: 7605
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: [Python Tool] Screengrabber for Linux

Post by VK3KYY » Sat Dec 07, 2019 10:59 pm

Hi Daniel

No worries

I can easily do it in the CPS. I already set the background colour to grey, and I think scaling the image is not difficult.

I'm sure Python (yes i hate it) has functions to do the same things

User avatar
F1RMB
Posts: 2708
Joined: Sat Nov 16, 2019 5:42 am
Location: Grenoble, France

Re: [Python Tool] Screengrabber for Linux

Post by F1RMB » Sat Dec 07, 2019 11:05 pm

Yes, it has it (already part of this script).

User avatar
F1RMB
Posts: 2708
Joined: Sat Nov 16, 2019 5:42 am
Location: Grenoble, France

Re: [Python Tool] Screengrabber for Linux

Post by F1RMB » Sun Dec 08, 2019 5:10 am

Hi,

I've updated the script in the first post. Default color is the same as EA3BIL used, default scale factor is 2.
It also works under Windows (you may need to install pillow, cimage and pyserial using pip.exe), default COM port is COM13.


Cheers.

VK3KYY
Posts: 7605
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: [Python Tool] Screengrabber for Linux

Post by VK3KYY » Sun Dec 08, 2019 6:25 am

Cool

I've not had time to change the CPS, because I've been bug fixing the Tone Scan PR

User avatar
F1RMB
Posts: 2708
Joined: Sat Nov 16, 2019 5:42 am
Location: Grenoble, France

Re: [Python Tool] Screengrabber for Linux

Post by F1RMB » Sun Dec 08, 2019 6:29 am

Hi Roger,

you have a PR for the CPS ;-)

Cheers.

VK3KYY
Posts: 7605
Joined: Sat Nov 16, 2019 3:25 am
Location: Melbourne, Australia

Re: [Python Tool] Screengrabber for Linux

Post by VK3KYY » Sun Dec 08, 2019 7:16 am

Thanks I've used your changes

Post Reply