This forum has been archived. All content is frozen. Please use KDE Discuss instead.

How to Automate KSnapshot Partial Screen Capture?

Tags: None
(comma "," separated)
bob p
Registered Member
Posts
2
Karma
0
OS
I really like KSnapshot. I'm trying to figure out a way to have it automatically save the same user-defined portion of a screen each time that is invoked.

I'd like to configure it so that it will automatically capture a section of the screen that I've pre-defined with a set of screen coordinates.

Is it possible to automate the task of caputuring a pre-defined section of the screen, so that I don't have to use the mouse to outline the capture area and click the save button every time that I start KSnapshot?

I am working on an application where I routinely have to capture the same portion of the screen, over and over and over again, and I'd really like to automate the process. The problem is that I need to not capture the entire screen, as a portion of the screen includes data that I don't want to include in the screen capture. If possible, I'd like to only capture the same portion of the screen over and over again, within a set of user-defined coordinates.

Optimally, I'd like to tie the configuration and the capture process to a keystroke, so that whenever I press the key combination, the program automatically captures the pre-defined portion of the screen and dumps it to a PNG file, with no further user input other than the initial keystroke.

I'm thinking there has to be a way to script this sort of behavior, and that it should be a fairly easy thing to do ... the problem is just that I have no idea how to do it.

TIA!
User avatar
google01103
Manager
Posts
6668
Karma
25
try a command line tool like import which has a geometry option

Code: Select all
import --help
Version: ImageMagick 6.6.5-8 2011-02-14 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2010 ImageMagick Studio LLC
Features: OpenMP

Usage: import [options ...] [ file ]

<snip>
Image Operators:
-annotate geometry text
annotate the image with text
-colors value preferred number of colors in the image
-crop geometry preferred size and location of the cropped image
-encipher filename convert plain pixels to cipher pixels
-geometry geometry preferred size or location of the image
-help print program options
-monochrome transform image to black and white
-negate replace every pixel with its complementary color
-repage geometry size and location of an image canvas
-quantize colorspace reduce colors in this colorspace
-resize geometry resize the image
-rotate degrees apply Paeth rotation to the image
-strip strip image of all profiles and comments
-thumbnail geometry create a thumbnail of the image
-transparent color make this color transparent within the image
-trim trim image edges
-type type image type

<snip>

By default, 'file' is written in the MIFF image format. To
specify a particular image format, precede the filename with an image
format name and a colon (i.e. ps:image) or specify the image type as
the filename suffix (i.e. image.ps). Specify 'file' as '-' for
standard input or output.


OpenSuse Leap 42.1 x64, Plasma 5.x



Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]