Method Image.Image()->autocrop()
- Method autocrop
autocrop()object
autocrop(objectintborder)
autocrop(objectintborder,Colorcolor)
autocrop(objectintborder,intleft,intright,inttop,intbottom)
autocrop(objectintborder,intleft,intright,inttop,intbottom,Colorcolor)
array(int) find_autocrop()
array(int) find_autocrop(intborder)
array(int) find_autocrop(intborder,intleft,intright,inttop,intbottom)- Description
-
Removes "unnecessary" borders around the image, adds one of its own if wanted to, in selected directions.
"Unnecessary" is all pixels that are equal -- ie if all the same pixels to the left are the same color, that column of pixels are removed.
The find_autocrop() function simply returns x1,y1,x2,y2 for the kept area. (This can be used with copy later.)
- Parameter
border - Parameter
left - Parameter
right - Parameter
top - Parameter
bottom -
which borders to scan and cut the image; a typical example is removing the top and bottom unnecessary pixels:
img=img->autocrop(0, 0,0,1,1);
- Returns
-
the new image object
- See also