Documentation for CoherentTransformations.
A matrix of noise is generated with
CoherentNoise and used to generate a vector field to translate different pixels.
ImageTransformations takes care of reconstructing the pixels according to this map. At the end the image is cropped and resized to match the original image without any empty pixels.
The most important function is
noise_warp which takes and image and a noise source to warp it.
noise_warp(img, noise_source::AbstractSampler; squared = true, variance = 0.1, crop = true)
noise_warp takes both an
img and a
noise_source built from
CoherentNoise.jl and returns a warpped image. The principle is simple:
- Two matrices of noise are generated using
- These matrices are converted into vector field by centering the values around 0
and scaling them with
variance * size.
- The vector field corresponds to the displacement of the pixels in the x/y coordinate field.
ImageTransformationsapply the transformations and adaptively warp the image.
cropis true, the image will be cropped to ensure no
NaNvalues are contained.
checkered_2d noise from
CoherenNoise for a checker effect
Use a combination of
ridged_fractal_3d for a ridged effect.
cylinders_2d noise from
CoherenNoise for a cylinder effect
spheres_3d noise from
CoherenNoise for a spherical effect
There is also the helper function.
This is a cheaper version of
CoherentNoise, which does not generate a
RGB matrix but a matrix of type