Documentation for CoherentTransformations.

CoherentTransformations is the beautiful combinations of CoherentNoise.jl and ImageTransformations.jl.

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 noise_source.
  • 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.
  • ImageTransformations apply the transformations and adaptively warp the image.
  • If crop is true, the image will be cropped to ensure no NaN values are contained.

There are also a few helper functions to directly use existing settings, see for example checker_warp and the examples in Example.

There is also the helper function.