Skip to content

Instantly share code, notes, and snippets.

@ctrlcctrlv
Created May 28, 2019 10:34
Show Gist options
  • Select an option

  • Save ctrlcctrlv/fdd9d3785a24d9b16df6d794db56ac36 to your computer and use it in GitHub Desktop.

Select an option

Save ctrlcctrlv/fdd9d3785a24d9b16df6d794db56ac36 to your computer and use it in GitHub Desktop.
Minimal example of the use of the filter cell-noise with python-gegl. Should apply to most other GEGL filters.
#!/usr/bin/env python3
# Minimal example of using the filter `cell-noise` with GEGL through python-gegl.
# Hopefully I can figure out how to import this into GIMP's Python console's environment.
# These two lines makes sure version of gegl is correct
import gi
gi.require_version('Gegl', '0.4')
import gegl
import random
x = gegl.Graph("cell-noise", "crop", "png-save")
x[2].path = '/tmp/vpp1.png'
x[1].height = 1024
x[1].width = 1024
# Seed bounds ( on my system anyway )
x[0].seed = random.randint(-2147483648, 2147483648)
x()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment