| Extracted from Pike v7.8 release 866 at 2016-04-05.

[Top]
Image
Image.Layer

# Method Image.Layer()->find_autocrop()

Method find_autocrop

  `object autocrop()`
  `object autocrop(int(0..1) left, int(0..1) right, int(0..1) top, int(0..1) bottom)`
  `array(int) find_autocrop()`
  `array(int) find_autocrop(int(0..1) left, int(0..1) right, int(0..1) top, int(0..1) bottom)`

Description

  This crops (of finds) a suitable crop, non-destructive crop. The layer alpha channel is checked, and edges that is transparent is removed.

  (What really happens is that the image and alpha channel is checked, and edges equal the fill setup is cropped away.)

  find_autocrop () returns an array of xoff,yoff,xsize,ysize, which can be fed to crop ().

Note

  A tiled image will not be cropped at all.

  `left`...`bottom` arguments can be used to tell what sides cropping are ok on.

See also

  crop , Image.Image->autocrop