Resize image by shrinking using maximum pixels? #4606
-
Is there a strategy by which I can resize images by shrinking them using the maximum pixels? The images are masks and I'd like to retain all 1's over 0's when resized. For However I can't find a similar means with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hello @larsmaxfield, You could run a rank filter before resizing with factor = 5
mask = max.rank(factor, factor, factor * factor - 1).(1.0 / factor, kernel="nearest") That'd do what you want for int factors at least. Not too quick though! |
Beta Was this translation helpful? Give feedback.
Hello @larsmaxfield,
You could run a rank filter before resizing with
nearest
. In python:That'd do what you want for int factors at least. Not too quick though!