ebsynth

repository·master·Indexed 23 days ago

https://github.com/jamriska/ebsynth

A fast, non-parametric, example-based image synthesizer for texture synthesis, artistic style transfer, and inpainting. It utilizes patch-based algorithms rather than neural networks to preserve fine details. The tool provides a CLI for by-example synthesis with options for controlling patch size, pyramid levels, and computation backends (CPU or CUDA), and supports complex tasks like illumination-guided stylization (StyLit) and face portrait stylization (FaceStyle) using multiple guiding channels.

Tokens
820
Snippets
3
Records
6
Agent score
32%

What's inside ebsynth

  1. How multiple guiding channels work in StyLit

    master

    For complex tasks like illumination-guided stylization (StyLit), you can use multiple guiding channels. Each -guide flag must be followed by a pair: <source_guide> and <target_guide>.

    To balance the influence of guides against the style, use the -weight flag. The style has a default weight of 1.0. If you want a 2:1 guide-to-style ratio using three guide channels, you can set each guide's weight to 0.66 (total guide weight = 0.66 * 3 = 1.98 $\approx$ 2.0).

  2. Run Ebsynth for basic image synthesis

    master

    Use the ebsynth CLI to perform by-example synthesis. The basic workflow requires a style image, a source guide image, a target guide image, and an output path. The tool transfers the style of the <style.png> onto the <target.png> by using the relationship between <source.png> and <source_segment.png> as a guide.

    ebsynth -style <style.png> -guide <source.png> <target.png> -output <output.png>
  3. Perform guided texture synthesis (Texture-by-numbers)

    master

    To perform basic guided texture synthesis, provide a source photograph and its segmentation as the guide, and a hand-painted target segmentation as the target. This transfers the texture of the photograph to the new segmentation while respecting the segments.

    ebsynth -style source_photo.png -guide source_segment.png target_segment.png -output output.png
  4. Stylize face portraits with FaceStyle

    master

    To transfer the style of a painting onto a person's photograph while preserving identity, use multiple structural guides:

    1. Appearance guide (Gapp): A grayscale version of the target photo equalized to the source painting's luminance.
    2. Segmentation guide (Gseg): A soft segmentation based on facial landmarks.
    3. Positional guide (Gpos): A dense warp field mapping target pixels to source positions.

    Use -weight to adjust the importance of these structural guides relative to the style.

  5. Ebsynth CLI options reference

    master

    The following command-line options are available for controlling the synthesis process:

    • -style <style.png>: The reference image containing the desired style.
    • -guide <source.png> <target.png>: A pair of images acting as a guide. The first is the source guide, the second is the target guide. Note: You can provide multiple guide pairs.
    • -weight <value>: Sets the contribution weight for the preceding guide pair. The default weight for the style is 1.0.
    • -uniformity <value>: Controls the uniformity of the synthesis.
    • -patchsize <value>: Sets the size of the patches used for synthesis.
    • -pyramidlevels <number>: Specifies the number of pyramid levels.
    • -searchvoteiters <number>: Number of search/vote iterations.
    • -patchmatchiters <number>: Number of PatchMatch iterations.
    • -extrapass3x3: Enables a 3x3 extrapolation pass.
    • -backend [cpu|cuda]: Selects the computation backend (CPU or CUDA).
    -style <style.png>
    -guide <source.png> <target.png>
    -weight <value>
    -uniformity <value>
    -patchsize <value>
    -pyramidlevels <number>
    -searchvoteiters <number>
    -patchmatchiters <number>
    -extrapass3x3
    -backend [cpu|cuda]