You can use the -crop WxH+X+Y
option for the import
command. To indicate the area of the screen. And the -quality
parameter for the quality / level of output compression. Something like that:
import -window root -crop 200x300+100+15 -quality 100 $(date +%Y%m%d-%H%M%S).png
Please note that the -quality
parameter for the .png
and .jpg
format has almost opposite values: a value of 10 for png means “less compression” (larger size), and a value of 100 means maximum compression (minimum size), On the other hand, a value of 10 for jpg means "lower quality" (smaller size), and a value of 100 means "maximum quality" (maximum size).
source share