| Extracted from Pike v7.8 release 866 at 2018-02-09.

[Top]
Image
Image.Image

# Method Image.Image()->select_from()

Method select_from

  `object select_from(int x, int y)`
  `object select_from(int x, int y, int edge_value)`

Description

  Makes an grey-scale image, for alpha-channel use.

  This is very close to a floodfill.

  The image is scanned from the given pixel, filled with 255 if the color is the same, or 255 minus distance in the colorcube, squared, rightshifted 8 steps (see distancesq ).

  When the edge distance is reached, the scan is stopped. Default edge value is 30. This value is squared and compared with the square of the distance above.

  35, 35, 16 | 35, 35, 32 | 35, 35, 64 | 35, 35, 96 | 35, 35, 128 | 35, 35, 192 | 35, 35, 256

  original | original * select_from(35,35,200)

Parameter `x`
Parameter `y`

  originating pixel in the image

Returns

  the new image object

See also

  distancesq