Hi dinasset! I tryin to create a Night scene (Not finished yet). Can you check the Solid Noise gegl command? I thought I had this one right but is not applying to the image.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: Pocholo
# date: 8/18/21
# Comments directed to http://gimpchat.com
# Installation:
# This script should be placed in the user plugin folder
# Copyright (C)
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
from gimpfu import *
import os, sys,time
import gettext
gettext.install("gimp20", gimp.locale_directory, unicode=True)
def create_a_beautiful_moonlight_scene():
#Initiates the temporary state
pdb.gimp_context_push()
pdb.gimp_context_set_defaults()
#Create the sky
img = pdb.gimp_image_new(1920, 1080, RGB)
Starslayer = pdb.gimp_layer_new(img, img.width, img.height, RGBA_IMAGE, "Small Stars", 100, LAYER_MODE_NORMAL)
pdb.gimp_image_insert_layer(img, Starslayer, None, 0)
pdb.gimp_layer_add_alpha(Starslayer)
pdb.gimp_context_set_foreground((0, 0, 0))
pdb.gimp_drawable_fill(Starslayer, FILL_FOREGROUND)
#Image process
pdb.gimp_display_new(img)
#Create the stars
pdb.plug_in_hsv_noise(img, Starslayer, 8, 0, 0, 255)
pdb.gimp_brightness_contrast(Starslayer, -80, 50)
pdb.plug_in_gauss(img, Starslayer, 0.50, 0.50, 1)
pdb.plug_in_sparkle(img, Starslayer, 0.001, 1.00, 20, 4, 15, 1.00, 0, 0, 0, FALSE, FALSE, FALSE, 0)
#Create the Moon
moonLayer = pdb.gimp_layer_new(img, img.width, img.height, RGBA_IMAGE, "Moon", 100, LAYER_MODE_NORMAL)
pdb.gimp_image_add_layer(img, moonLayer, 0)
pdb.gimp_drawable_fill(moonLayer, FILL_TRANSPARENT)
pdb.gimp_context_set_foreground("White")
pdb.gimp_image_select_ellipse(img, 2, 810, 75, 306, 306)
pdb.gimp_edit_bucket_fill(moonLayer, BUCKET_FILL_FG, LAYER_MODE_NORMAL, 100, 255, FALSE, 0, 0)
pdb.plug_in_solid_noise(img, moonLayer, FALSE, FALSE, 0, 15, 0.8, 0.8)
pdb.gimp_selection_none(img)
#Create a texture on the moon
pdb.gimp_file_save(img, moonLayer, "C:\\temp\\Moon.png", "Moon.png")
moonLayer=pdb.gimp_image_get_active_layer(img)
pdb.python_gegl(img, moonLayer,
'bump-map aux=[load path="C:\\temp\\Moon.png"] compensate=1 invert=0 tiled=0 azimuth=220 elevation=30 depth=7 offset-x=0 offset-y=0 waterlevel=1.00 ambient=1.00')
pdb.gimp_image_select_item(img, 2, moonLayer)
pdb.gimp_selection_shrink(img, 6)
pdb.gimp_selection_invert(img)
pdb.gimp_drawable_edit_clear(moonLayer)
#Moon glow
glowLayer = pdb.gimp_layer_new(img, img.width, img.height, RGBA_IMAGE, "Moon glow", 100, LAYER_MODE_NORMAL_LEGACY)
pdb.gimp_image_add_layer(img, glowLayer, 1)
pdb.gimp_drawable_fill(glowLayer, FILL_TRANSPARENT)
pdb.gimp_context_set_foreground("White")
pdb.gimp_image_select_item(img, 2, moonLayer)
pdb.gimp_edit_bucket_fill(glowLayer, BUCKET_FILL_FG, LAYER_MODE_NORMAL, 100, 255, FALSE, 0, 0)
pdb.gimp_selection_none(img)
pdb.plug_in_gauss(img, glowLayer, 150, 150, 1) #method=1
#Create the sea
seaLayer = pdb.gimp_layer_new(img, img.width, img.height, RGBA_IMAGE, "Sea", 100, LAYER_MODE_NORMAL)
pdb.gimp_image_add_layer(img, seaLayer, 0)
pdb.gimp_context_set_foreground((3, 3, 5))
pdb.gimp_drawable_fill(seaLayer, FILL_FOREGROUND)
wavesLayer = pdb.gimp_layer_new(img, img.width, img.height, RGBA_IMAGE, "Waves", 100, LAYER_MODE_NORMAL)
pdb.gimp_image_add_layer(img, wavesLayer, 0)
pdb.gimp_drawable_fill(wavesLayer, FILL_WHITE)
pdb.python_gegl(img, wavesLayer, 'noise-solid x-size=16.00 y-size=16.00 detail=15 tileable=0 turbulent=0 seed=0 width=1920 height=1080')
#Make active the bottom layer and done
pdb.gimp_image_set_active_layer(img, Starslayer)
#Set gimp to default
pdb.gimp_context_pop()
register(
"create_a_beautiful_moonlight_scene",
"Creates Stars and a Moon",
"Creates Stars and a Beautiful Moonlight over a Sea",
"Pocholo",
"Pocholo",
"2021",
"Create a Beautiful Moonlight Scene",
"",
[
],
[],
create_a_beautiful_moonlight_scene, menu="<Image>/Pocholo-scripts/Beautiful Moonlight scene",
domain=("gimp20", gimp.locale_directory))
main()