11

This is a question about image file cropping.

I recently posted a public notice to an Indian newspaper called the Free Press Journal. This is available online as The Free Press Epaper.

Now, one can download a notice that was posted in the paper as a JPG file. However, this JPG can, and in my case, does, include multiple notices. These notices are mostly long thin rectangles running vertically, filling up the image.

I'm wondering if anyone can suggest a simple approach to "slice" the segment containing the desired notice out of the image file. I could also convert to another format if it would make this slicing process easier. A method to make the image larger if necessary would also be a plus.

slm
  • 369,824
Faheem Mitha
  • 35,108

3 Answers3

14

ImageMagick has a number of programs in the package. One of them, display, will render an image on the screen and provide easy access to a lot of the Imagemagick suite.

$ display your_original_image.jpg

Then left-mouse click in display window to bring up the ImageMagick command window. To crop the image, left-mouse click on "Transform" and then select "Crop" by left-mouse clicking. Then on your image, left-mouse click and drag over the area you wish to keep. Release the mouse button to select the area. Then select "Crop" to actually modify the displayed image. To save this modified image, select "File" and then "Save...". A window with familiar controls will pop-up and allow you to save your cropped image.

rickhg12hs
  • 1,235
  • 1
    This looks like a good approach. Unfortunately, the desired area is so long it does not fit completely on my screen. Dragging to select the area, and scrolling down don't seem to work together, so I've not been to select the entire area. – Faheem Mitha Nov 02 '13 at 20:44
  • I would probably only use display for quick edits. Strange that it won't zoom out, especially since you can zoom in. For most image editing, gimp is the Linux power tool, but it does have a learning curve. Here's a gimp tutorial on cropping. http://docs.gimp.org/en/gimp-tutorial-quickie-crop.html – rickhg12hs Nov 03 '13 at 01:55
  • 1
    Thanks for the link, rickhg12hs. I was indeed able to use gimp to crop the image. – Faheem Mitha Nov 03 '13 at 08:04
11

No time for a full solution but you could use ImageMagick and it's crop fuctionality.

Example

$ convert rose: -crop 40x30-10-10  crop_tl.gif

original: original               cropped: cropped

slm
  • 369,824
  • Considering the number of upvotes your answer is getting, you should expand it to a full solution. And then let me know, so I can upvote your answer as well. – Alex Mar 09 '20 at 13:31
8

I guess if you've never used gimp it could take you five or ten minutes to get comfortable using the "crop" tool:

GIMP

Or it might not take that long. Gimp should be available on any linux distro. There's some documentation here. You can load a .jpg, but if you want to save it that way you have to choose "Export As" from the file menu.

goldilocks
  • 87,661
  • 30
  • 204
  • 262