#! /bin/csh
#
# usage: cut_icon X Y W H
#
# This filter reads an icon file from standard input, cuts out a WxH
# rectangle with upper left corner at (X,Y), and writes the result on
# standard output in icon file format.  Any additional comments in the
# file will be lost in the process.
# 
# A file produced by cut_icon may be edited with iconedit(1), but
# after saving it you will have to run it through cut_icon again,
# because iconedit always writes 64 by 64 icons.
#
# The 'pbm' programs used here are part of the "Portable Bitmap
# Toolkit" by Jef Poskanzer.  This collection of programs can be
# obtained via anonymous ftp from expo.lcs.mit.edu (18.30.0.212).
# Look for the something like pbm.tar.Z, etc.

icontopbm | pbmcut $1 $2 $3 $4 | pbmtoicon
