Question

Question

As an example, is there an easy way to crop away the o's in the Google logo (knowing their coordinates in advance)?

The result should then be "Ggle" with a smaller image width than the original because the o's are missing.

It doesn't have to be done with ImageMagick. It could also be Gimp, Inkscape or anyother Linux program, that can be scripted from commandline.

enter image description here

Was it helpful?

Solution 2

One option is to use the 'chop' option with 'convert' from the command line - details.

Another option is to use shave.

Note that in both cases you will probably have to make 2 images, left and right piece, and then merge them together with something like the 'append' option (details).

For actual command line scripts, look here.

OTHER TIPS

If Google.png is 538 x 190 px, then the 'G' is 140px wide and the 'gle' is 208px wide, leaving a block that is 190 x 190 px in the middle that you want to chop out. In ImageMagick:

convert Google.png -chop 190x190+141+190 Ggle.png

where the first measurement is the size of the block to be chopped and the rest indicates where to start chopping. Resulting in Ggle.png:
enter image description here

Run:

display Google.png

Click on the image. A menu will appear. Click Transform > Chop. You can now choose Direction (Horizontal or Vertical). Now click and drag the portion you want to remove. Now Click File > Save.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top