Thank you MareroQ. Can you explain me how you did it? I'm puzzle!
from gimpfu import *
def pm_jean__seamless_texture(size, fgColor):
pdb.gimp_context_push()
size = 500
fgColor = (51, 112, 172)
#Create the first blue layer
img = pdb.gimp_image_new(size, size, RGB)
layer = pdb.gimp_layer_new(img, size, size, RGB, "Jean", 100, LAYER_MODE_NORMAL)
pdb.gimp_image_add_layer(img, layer, 0)
pdb.gimp_context_set_foreground (fgColor)
pdb.gimp_drawable_fill(layer, FILL_FOREGROUND)
#Create a new layer fill with Noise and change the layer mode
layer = pdb.gimp_layer_new(img, size, size, RGB, "Blue1", 100, LAYER_MODE_GRAIN_MERGE)
pdb.gimp_image_add_layer(img, layer, 0)
pdb.gimp_drawable_fill(layer, FILL_FOREGROUND)
pdb.plug_in_hsv_noise(img, layer, 1, 180, 0, 255)
pdb.gimp_layer_set_mode(layer, LAYER_MODE_GRAIN_MERGE)
#Create a layer and change layer mode
layer = pdb.gimp_layer_new(img, size, size, RGB, "Blue2", 100, LAYER_MODE_NORMAL)
pdb.gimp_image_add_layer(img, layer, 0)
pdb.gimp_context_set_foreground (fgColor)
pdb.gimp_drawable_fill(layer, FILL_FOREGROUND)
pdb.gimp_layer_set_mode(layer, LAYER_MODE_GRAIN_MERGE)
#Create a layer and create the texture
layer = pdb.gimp_layer_new(img, size, size, RGB, "Texture", 100, LAYER_MODE_NORMAL)
pdb.gimp_image_add_layer(img, layer, 0)
pdb.gimp_context_set_foreground (fgColor)
pdb.gimp_drawable_fill(layer, FILL_FOREGROUND)
pdb.gimp_layer_set_mode(layer, LAYER_MODE_MULTIPLY)
pdb.plug_in_newsprint(img, layer,
6,
0,
0,
55,
1,
55,
1,
55,
1,
55,
1,
50)
#Merge all layers
layer = pdb.gimp_image_merge_visible_layers(img, CLIP_TO_BOTTOM_LAYER)
gimp.Display(img)
pdb.gimp_context_pop()
register(
"pm_jean__seamless_texture",
"Creates a denim texture",
"Creates a denim seamless texture",
"Pocholo",
"Pocholo",
"2020",
"Jean texture",
"",
[
(PF_COLOR, "fgcolor", "Texture color", (51, 112, 172)),
(PF_SPINNER, "size", "Texture size", 500, (100, 1000, 1)),
],
[],
pm_jean__seamless_texture, menu="<Image>/Python-Fu/Jean texture")
main()