Loading
Home ›
Slice and Dice Images with ImageMagick
Dec 10, 2008 By Janos Gyerik
in
You can use the convert command that comes with ImageMagick to extract parts of an image.
You can cut out a 100-pixel-wide chunk from somewhere in the middle of an image:
$ convert -crop 100x+0+0 orig/wrapperbg775.gif slice0.gif $ convert -crop +200+0 orig/wrapperbg775.gif slice1.gif $ convert +append slice0.gif slice1.gif wrapperbg675.gif
You can duplicate a 100-pixel-wide chunk from somewhere in the middle of an image:
$ convert -crop 100x+100+0 orig/wrapperbg775.gif slice100.gif $ convert +append slice0.gif slice100.gif slice 100.gif ↪slice1.gif wrapperbg875.gif
Note that there was no need to specify the height of the image in any of the above commands. If you need to adjust the height instead of the width, the steps are similar, but use -append instead of +append to paste the slices vertically.
______________________
Trending Topics
| You Need A Budget | Feb 10, 2012 |
| The Linux powered LAN Gaming House | Feb 08, 2012 |
| Creating a vDSO: the Colonel's Other Chicken | Feb 06, 2012 |
| Your CMS Is Not Your Web Site | Feb 01, 2012 |
| Casper, the Friendly (and Persistent) Ghost | Jan 31, 2012 |
| Razor-qt 0.4 - Qt based Desktop Environment | Jan 30, 2012 |
- Fun with ethtool
- Parallel Programming with NVIDIA CUDA
- Readers' Choice Awards 2011
- 100% disappointed with the decision to go all digital.
- Linux-Based X Terminals with XDMCP
- Validate an E-Mail Address with PHP, the Right Way
- You Need A Budget
- The Linux powered LAN Gaming House
- Why Python?
- Python for Android





3 hours 37 min ago
4 hours 57 min ago
7 hours 40 min ago
12 hours 11 min ago
17 hours 18 min ago
18 hours 18 min ago
1 day 3 hours ago
1 day 3 hours ago
1 day 10 hours ago
1 day 13 hours ago