class StyleTransfer extends SourceBasedEffectAction

Applies a complex deep learning neural network algorithm that extracts artistic styles from a source image and applies them to the content of a target photograph.

Learn more: Neural Artwork Style Transfer

Methods

__construct(String|Media $source, int $strength = null, bool $preserveColor = null)

StyleTransfer constructor.

preserveColor(bool $preserveColor = true)

Determines whether the original colors of the target photo are kept.

strength(int $strength)

Sets the strength of the style transfer.

Details

__construct(String|Media $source, int $strength = null, bool $preserveColor = null)

StyleTransfer constructor.

Parameters

Name Type Description
$source String|Media The public ID of the source artwork.
$strength int Sets the strength of the style transfer.
$preserveColor bool Determines whether the original colors of the target photo are kept.

StyleTransfer preserveColor(bool $preserveColor = true)

Determines whether the original colors of the target photo are kept.

Parameters

Name Type Description
$preserveColor bool When true, style elements of the source artwork, such as brush style and texture, are transferred to the target photo, but the prominent colors from the source artwork are not transferred, so the result retains the original colors of the target photo.

Return Value

StyleTransfer

StyleTransfer strength(int $strength)

Sets the strength of the style transfer.

Parameters

Name Type Description
$strength int The strength of the style transfer. Higher numbers result in an output that is more highly influenced by the source artwork style. (Range: 0 to 100, Server default: 100)

Return Value

StyleTransfer