Procedually generate texture images from noise.
The noise
of this repository contains two directories, cynoise
and pynoise
. cynoise
has Cython source code and must be built by setup.py to use.
If it has been build, the fast Cython code is used, if not, python code is used.
See NoiseTexture for the difference in speed.
- Cython 3.0.12
- numpy 2.2.4
- opencv-contrib-python 4.11.0.86
- opencv-python 4.11.0.86
- Python 3.12
- Windows11
git clone --recursive https://github.com/taKana671/TextureGenerator.git
cd TextureGenerator
python setup.py build_ext --inplace
If the error like "ModuleNotFoundError: No module named ‘distutils’" occurs, install the setuptools.
pip install setuptools
Output procedural texture images from noise.
For more details of methods and parameters, please see source codes.
from texture_generator.cloud import Cloud
maker = Cloud.from_vfractal() # using fractal Value Noise.
# maker = Cloud.from_pfractal() # using fractal Perlin Noise.
# maker = Cloud.from_sfractal() # using fractal Simplex Noise.
# maker = Cloud.from_file('noise_5.png') # using noise image file.
# output a cloud image composited with a background image.
maker.create_cloud_image()
The cubemap is seamless and each skybox image can be connected exactly.
See skybox.
from texture_generator.cubemap import CubeMap
from utils.output_image import output
maker = CubeMap.from_sfractal() # using fractal Simplex Noise.
# maker = CubeMap.from_pfractal() # using fractal Perlin Noise.
# maker = CubeMap.from_vfractal() # using fractal Value Noise.
# output a grayscale cubemap image.
img = maker.create_cubemap()
output(img, 'cubemap')
# output skybox images composited with a background image.
maker.create_skybox_images()
from texture_generator.spheremap import SphereMap
from utils.output_image import output
# using fractal Simplex Noise.
maker = SphereMap.from_sfractal()
# output a grayscale sphere map image.
img = maker.create_spheremap()
output(img, 'spheremap')
# output a sky sphere image composited with a background image.
maker.create_skysphere_image()
from texture_generator.spheremap import SphereMap
from output_image import output
# using fractal Simplex Noise.
maker = SphereMap.from_sfractal()
# output a grayscale cubemap image converted from a sphere map.
img = maker.create_cubemap()
output(img, 'cubemap')
# output skybox images composited with a background image.
maker.create_skybox_images()