(C1) The output should contain only those NxN patterns of pixels that are present in the input. (Weak C2) Distribution of NxN patterns in the input should be similar to the distribution of NxN ...
This addon is available in Godot Asset Library and thus can be installed using editor's built-in addon manager. Alternatievely, you can download an archive from releases page or from current branch.