Warning: session_start(): open(/var/lib/php/sessions/sess_os6nhtqac0dhk5llbfqugmc225, O_RDWR) failed: No space left on device (28) in /var/www/tb-usercake/models/config.php on line 51
Warning: session_start(): Failed to read session data: files (path: /var/lib/php/sessions) in /var/www/tb-usercake/models/config.php on line 51
static Image2B binaryImageOutline(IImage2B image) {
int w = image.w(), h = image.h();
ret image == null ?: binaryImageFromFunction(w+2, h+2,
(x, y) ->
!(
// white if pixel was black before
getBoolPixelDefaultTrue(image, x, y) ? false
// otherwise, black if surrounded by at least one black pixel
: (
getBoolPixelDefaultTrue(image, x-1, y-1)
|| getBoolPixelDefaultTrue(image, x, y-1)
|| getBoolPixelDefaultTrue(image, x+1, y-1)
|| getBoolPixelDefaultTrue(image, x-1, y)
|| getBoolPixelDefaultTrue(image, x+1, y)
|| getBoolPixelDefaultTrue(image, x-1, y+1)
|| getBoolPixelDefaultTrue(image, x, y+1)
|| getBoolPixelDefaultTrue(image, x+1, y+1))));
}