Recent Posts
None | 36 sec ago
C# | 1 min ago
Delphi | 2 min ago
Delphi | 2 min ago
Delphi | 2 min ago
Delphi | 2 min ago
C# | 2 min ago
PHP | 2 min ago
PHP | 2 min ago
Delphi | 2 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Anonymous on the 16th of Nov 2008 03:17:41 PM Download | Raw | Embed | Report
  1. #!/bin/bash
  2. # Breaking/splitting a image into pieces
  3. if [ $# != 5 ] ; then
  4.         echo "split.sh <file> <original x pixels> <original y pixels> <slice x pixels> <slice y pixels>"
  5.         exit
  6. fi
  7. file=$1
  8. originalx=$2
  9. originaly=$3
  10. slicex=$4
  11. slicey=$5
  12. numberx=$((originalx/slicex))
  13. numbery=$((originaly/slicey))
  14.  
  15. for i in `seq 0 $numberx`; do
  16.   for j in `seq 0 $numbery`; do
  17.     convert -crop ${slicex}x${slicey}+$((i*slicex))+$((j*slicey)) $file $file-$j-$i.png
  18.   done
  19. done
Submit a correction or amendment below. [ previous version ] | [ difference ] | Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: