1

Ubuntu 18.04

I have been running Gnome-screenshot sometimes. But I couldn't take a screenshot with a predefined pixel size.

I have been searching a while on Internet for command line screenshot package but I found many suggestions there.

Can any folk online sharing me his experience. What I need is taking a screenshot with my required pixel size.

Thanks in advance.

Regards SL

1 Answers1

0

If I understand your question correctly, you want to have a command to capture a specific area of your desktop without having to subsequently crop the image.

For example, you want to capture a rectangle 500px wide and 300px high. And this rectangle is 200px from the left edge of your screen and 10px from the top of your screen.

You can do so with maim which can be installed with sudo apt install maim.

Assign a keyboard shortcut to the following code:

maim --geometry=500x300+200+10 ~/Pictures/$(date +%Y%m%d%H%S.png)

Now, each time you press the keyboard shortcut, an image of the specified size and position will be saved in ~/Pictures with a timestamp and .png as the extension. (You can use the jpeg format if you prefer). Check man maim for other options and visit the project's homepage for more ideas.

DK Bose
  • 42,548
  • 23
  • 127
  • 221