clip

2021.6 Fills with a color the area delimited by a clipping path contained in the image.

This command destroys the clipping paths and therefore cannot be used several times in a chaining.

parameters

  • background color: a color value. Specifies the background filling color. Default value is none (so black in a non transparent image).

  • clipping path: the name or the index of the wanted clipping path (the index is a number from 1 to n preceded by an octothorp (#)). Default is #1.

  • outside or inside: to fill the outside or inside of the clipping path. Default is true (so outside)

  • the colorization factor: a number between 1 and 100 (or a triplet of factors, one for each channel, (red, green or blue), three numbers separated by a comma), it allows you to define the blend between the fill color and the part of the image in the area to be filled. This factor only applies to a base color (not to gradients, patterns or blur). Default is 100 (so 100%, so no blending).

JSON object properties

  • background or color: the filling color

  • clippath or name: the name (or index) of clipping path

  • outside: a boolean, to specify if the inside or the outside of the clipping path must be filled

  • colorize: colorization

simplified syntax parameters

  • prefix bg: the filling color

  • prefix cp: the clipping path (or prefix n for name)

  • switch outside: +outside to fill outside, -outside to fill inside

  • prefix cl: the colorization factor

array type parameters

string

The filling color

Example 1 - Clip and fill with a color

{ "clip": "dodgerblue" }

Flamingo: W2983×H3977 (two paths: Flamingo,Montagne)

Flamingo: W2983×H3977

Simplified syntax: bg_dodgerblue,c_clip

Example 2 - Clip along a designated clipping path

{ "clip": { "background": "dodgerblue", "clippath":"#2" }

Flamingo: W2983×H3977 (two paths: Flamingo,Montagne)

Flamingo: W2983×H3977

 

Simplified syntax: bg_dodgerblue,cp_#2,c_clip

Example 3 - Clip along a named clipping path

{ "clip": { "background": "$gradient:DarkBlue-Turquoise", "name":"Flamingo" }

Flamingo: W2983×H3977 (two paths: Flamingo,Montagne)

Flamingo: W2983×H3977

Simplified syntax: bg_$gradient:DarkBlue-Turquoise,n_Flamingo,c_clip

If the name of the clipping path contains spaces, or special characters, embrace it between double-quotes: bg_DodgerBlue,n_"other path",c_clip

Example 4 - Clip with half blending

Flamingo: W2983×H3977 (two paths: Flamingo,Montagne)

Flamingo: W2983×H3977

Simplified syntax: bg_red,cl_50,c_clip

Example 5 - Clip inside

 

Flamingo: W2983×H3977 (two paths: Flamingo,Montagne)

Flamingo: W2983×H3977

Simplified syntax: bg_blue,cl_50,-outside,c_clip