How is the photoshop cutout filter implemented?

前端 未结 9 834
日久生厌
日久生厌 2021-02-03 13:21

Photoshop has a lot of cool artistic filters, and I\'d love to understand the underlying algorithms.

One algorithm that\'s particularly interesting is the Cutout filter

9条回答
  •  星月不相逢
    2021-02-03 13:37

    Got a simple solution, which would theoretically produce something similar to that filter. Somehow similar to what Ismael C suggested.

    Edge Simplicity controls window size. Maybe window should be weighted.

    But unlike it happens for regular windowed filters this one would take only a fixed size portion of random pixels from this window. The size of the portion is controlled with Fidelity parameter.

    Set the pixel color to the median of the sample.

    Given we have some posterization algorithm, it is applied afterwards.

    Here we go!

    Please report results if you implement it.

    PS. I really doubt that segmentation is used at all.

提交回复
热议问题