-
Hello. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @jpka-, You do this by expanding the input image and cropping the output, for example (in python): image = image \
.embed(2, 2, image.width + 5, image.height + 5, extend="background", background=[1,2,3]) \
.rank(5, 5, 0) \
.crop(2, 2, image.width, image.height) It sounds a little inefficient, but libvips is demand-driven, so it'll only compute the pixels it needs for the output.
|
Beta Was this translation helpful? Give feedback.
Hi @jpka-,
You do this by expanding the input image and cropping the output, for example (in python):
It sounds a little inefficient, but libvips is demand-driven, so it'll only compute the pixels it needs for the output.
im_rank
is the old vips7 interface, it'svips_rank()
now:https://www.libvips.org/API/current/method.Image.rank.html