Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question
    
There are lots of graphical tools available too. Which distro are you using? –  rickhg12hs Nov 2 '13 at 12:25
    
@rickhg12hs: Debian –  Faheem Mitha Nov 2 '13 at 12:27
    
@FaheemMitha - were you looking for something more than what was provided? LMK, there are a slew of tools beyond what was listed. –  slm Nov 2 '13 at 15:49
    
@slm I think one of the options mentioned in the (currently 3) answers should work for me, though I haven't tried any of them yet. –  Faheem Mitha Nov 2 '13 at 16:25
add comment

3 Answers

up vote 3 down vote accepted

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.

share|improve this answer
add comment

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

share|improve this answer
add comment

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.

share|improve this answer
    
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 2 '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. docs.gimp.org/en/gimp-tutorial-quickie-crop.html –  rickhg12hs Nov 3 '13 at 1:55
1  
Thanks for the link, rickhg12hs. I was indeed able to use gimp to crop the image. –  Faheem Mitha Nov 3 '13 at 8:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.