(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().
left...bottom arguments can be used to tell what sides cropping are ok on.
"normal", "add", "subtract", "multiply", "divide", "modulo", "invsubtract", "invdivide", "invmodulo", "difference", "max", "min", "bitwise_and", "bitwise_or", "bitwise_xor",
"replace", "red", "green", "blue",
"replace_hsv", "hue", "saturation", "value", "color",
"darken", "lighten",
"dissolve", "behind", "erase",
available_modes() simply gives an array containing the names of these modes.
"image":image, // default: blackThe layer can also be created "empty", either giving a size and color - this will give a filled opaque square, or a color, which will set the "fill" values and fill the whole layer with an opaque color."alpha":alpha, // alpha channel object // default: full opaque
"mode":string mode, // layer mode, see mode. // default: "normal"
"alpha_value":float(0.0-1.0), // layer general alpha value // default is 1.0; this is multiplied // with the alpha channel.
"xoffset":int, "yoffset":int, // offset of this layer
"fill":Color, "fill_alpha":Color, // fill color, ie what color is used // "outside" the image. default: black // and black (full transparency).
"tiled":int(0|1), // select tiling; if 1, the image // will be tiled. deafult: 0, off
All values can be modified after object creation.
The fill values are used if the layer is enlarged.
As an example, the XCF and PSD image decoders set the 'name' attribute to the name the layer had in the source file.