Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am working to create a Google group for Ubuntu but one thing I want to do is create the main image that goes in the top (The one that divides into 5 pieces). How can I divide an image horizontally (Or vertically) via Terminal or GUI.

For example I grab a Ubuntu Quantal image and tell a GUI or terminal program to divide the image in 5 equal parts horizontally (In this case).

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

Install ImageMagick, and then use the command convert:

convert -crop 20%x100% rose.jpg rose2.jpg  

Explanation:

  • 20% is 1/5 of 100% and therefore will crop the image in 5 equal parts.
  • 100% tell it will not be croped vertically.
  • rose.jpg is the original file.
  • rose2.jpg is the output.
share|improve this answer
    
Thanks for the explanation. Was going to ask about the % before going for the --help of the command. Is there an option to crop it vertically. I would think to first flip it 90 degrees then crop it, then flip it back -90 degrees but maybe there is another way. –  Luis Alvarado May 29 '12 at 0:58
2  
Just invert the command 20%x100% to 100%x20%: convert -crop 100%x20% rose.jpg rose2.jpg –  desgua May 29 '12 at 1:06
    
Amazing really. Very easy to know and apply. –  Luis Alvarado May 29 '12 at 1:12
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.