/run/media/bill/PROJECTS/System_maintenance/images/image extract.txt www.BillHowell.ca 04Dec2019 initial # /run/media/bill/PROJECTS/Photo Albums/ALBUM-1966-1972-Aust.Isreal/scan20190421_16572741.jpg # ist column, then 2nd column # upper left lower right size_hor size_ver #1 437 598 4140 4301 3703 3203 #2 414 4619 4094 8309 3680 3690 #3 483 8763 4163 12397 3680 3634 #2 4715 506 8395 4186 3680 3680 #4 4738 4600 8349 8372 3611 3772 #6 n/a # probably all points are +-50 pixels? +-----+ convert - this is already installed https://askubuntu.com/questions/631689/cropping-images-using-command-line-tools-only Here is a workaround using convert from image magick pack. sudo apt-get install imagemagick For a picture image.jpg identify image.jpg image.jpg JPEG 720x482 720x482+0+0 8-bit DirectClass 100KB 0.000u 0:00.009 As shown above, the input image is 720x482px. Now to do cropping you have to determine two factors: starting point of the cropping (includes 2 directions) The cropped rectangle size (Here you can include the other directions) Now back to the image image.jpg above, I want to crop: top 5px bottom 7px right 14px left 3px then you could do it with (widthxheight+left+top / wxh+l+t format): convert image.jpg -crop 703x470+3+5 output.jpg Now $ identify output.jpg output.jpg JPEG 703x470 703x470+0+0 8-bit DirectClass 102KB 0.000u 0:00.000 edited Mar 1 at 13:23 el-teedee 1471010 bronze badges answered Jun 3 '15 at 8:48 Maythux 62.5k3636 gold badges190190 silver badges236236 bronze badges >> for me (test) : see "$d_bin""image crop.sh" +-----+ Close this application before trying again. >> what is ruby? https://itsfoss.com/apt-vs-apt-get-difference/ try $ sudo apt install patextract System management is locked by the application with pid 26896 (/usr/bin/ruby.ruby2.5). Close this application before trying again. https://www.linuxquestions.org/questions/linux-newbie-8/what-is-the-open-suse-equivalent-to-apt-get-install-723246/ 05-03-2009, 12:20 AM #2 r_sreekumar LQ Newbie sudo zypper install xxxx bye sree $ sudo zypper install patextract [sudo] password for root: System management is locked by the application with pid 26896 (/usr/bin/ruby.ruby2.5). Close this application before trying again. https://wiert.me/2015/08/24/zypper-or-yast-locked-system-management-is-locked-by-the-application-with-pid-usrlibyast2biny2base/ Zypper or YaST locked: System management is locked by the application with pid ##### (/usr/lib/YaST2/bin/y2base). Posted by jpluimers on 2015/08/24 A simple kill would get rid of that process: sudo kill 17730 >> I killed with sudo kill 26896 ~ $ sudo zypper install patextract System management is locked by the application with pid 26896 (/usr/bin/ruby.ruby2.5). Close this application before trying again. https://www.phoronix.com/forums/forum/software/desktop-linux/36141-opensuse-13-1-switching-to-ruby-based-yast >> i.e. ruby is the basis of Yast!!! How do I get around this? +-----+ https://linux.die.net/man/1/visgrep Interesting : visgrep(1) - Linux man page Name visgrep - Visual grep, greps for images in another image Synopsis visgrep [options] image.png detect.pat match.pat ... Description visgrep is a program that greps for image in another image. All .pat files are created using png2pat(1) or rgb2pat(1). The image.png is scanned for detect.pat starting from X,Y given in parameters. When detect.pat is found, then all the match.pat files are scanned at an offset of x,y given in parameters. If a match is found, then visgrep prints the x,y and index of the item. For example, image.png is a screenshot and match1.pat .. match5.pat are images of letters a to e. Each of these letters is enclosed in a blue box, so detect.pat is an image of the upper left corner of the box. This box is not included in the match*.pat files, so they are actually offset 5 pixels down and 4 pixels to the left. You might run it like this then: visgrep -x-4 -y5 image.png match_corner.pat match_a.pat match_b.bat ... Etc, with all matches listed. Now suppose the screen showed ace so visgrep might output: 10,10 0 50,10 2 90,10 4 Showing that match_a.pat (index 0) is at 10,10 on the screen. If no match is found even though the detection image is found, the index will be -1. # enddoc