# Crop proc (icon)

Source: https://ref.dm-lang.org/icon/proc/Crop

### Format
> `Crop(x1,y1,x2,y2)`

### Args
- `x1,y1`: Coordinates of one corner of the rectangle (1,1 is the lower left)
- `x2,y2`: Coordinates of the other corner


A portion of the current icon is cropped (cut). If the crop region extends outside the icon, it will be padded with transparent pixels.

If using the TILED_ICON_MAP value for map_format, all icons must be even multiples of world.tile_size, so the icon will be padded with transparent pixels to the top and right as needed.

```dm /Crop/
// start with a simple icon
var/icon/I = new('circle.dmi')
// take the upper right 16x16 chunk
I.Crop(17,17,32,32)
// that chunk now appears in the lower left corner
icon = I
```

### See also
- [icon](https://ref.dm-lang.org/icon/index.md)
- [procs (icon)](https://ref.dm-lang.org/icon/proc/index.md)
- [icon_size var (world)](https://ref.dm-lang.org/world/var/icon_size.md)
- [map_format var (world)](https://ref.dm-lang.org/world/var/icon_size.md)
- [Big icons](https://ref.dm-lang.org/notes/big-icons.md)
- [Tiled icons](https://ref.dm-lang.org/notes/tiled-icons.md)
