Contacts
- Bruno Galerne
galerne@cmla.ens-cachan.fr - Yann Gousseau
gousseau@tsi.enst.fr - Jean-Michel Morel
morel@cmla.ens-cachan.fr
References
- B. Galerne, Y. Gousseau and J.-M. Morel,
Random Phase Textures: Theory and Synthesis,
preprint CMLA N°2009-24, 2009.
Abstract and pdf file on CMLA preprint webpage.
Overview
The Random Phase Noise (RPN) algorithm synthesizes a texture from any original image by randomizing its Fourier phase. The RPN algorithm is able to reproduce the textures which are characterized by their Fourier modulus, namely the phase invariant textures.
The presented algorithm deals with color images and it is able to synthesize output textures having a larger size than the input samples.
Even though this texture synthesis algorithm only reproduce a limited class of textures, it has several good properties:
- It produces a micro-texture given any input image, and thus can be used to produce micro-texture versions of some macro-textures, or can also be used to design textures.
- The algorithm is perceptually stable: all the textures synthesized from the same input image look similar.
- The algorithm is fast.
Online Demo: Try It!
An on-line demo of this algorithm is available.
The demo permits to upload a color texture sample and to replicate it in arbitrary size. Texture samples can be taken from existing databases, but to have still more realistic samples, you can extract them as homogeneous regions of a photograph, as shown below in What are micro-textures?
Source Code
An implementation is available for download: source code zip tar/gz , documentation.
This code requires libtiff, libfftw3 and getopt. It should
compile on any system since it's only ANSI C. A basic compilation
script is included.
Algorithm
Basic RPN
By definition, the RPN of an image is the random image obtained by
adding a random phase to the Fourier phase of the image. By a random
phase we mean an uniform white noise image over [0, 2
] that is constrained to be symmetric.
Extension to Color Images
The RPN of an RGB color image is obtained in adding the same random phase to the Fourier transform of each color channel. Adding the same random phase to the original phases of each color channel preserves the phase displacement between channels. This is important as it permits to create new textures without creating false colors.
Avoiding Artifacts Due to Non Periodicity
The RPN algorithm is based on the FFT and the periodicity of the input image is a critical requirement. Indeed, as experiments show, randomizing the phase of an image which is not periodic creates strong artifacts consisting in highly contrasted horizontal and vertical waves. To avoid these artifacts the input image is replaced by its periodic component as defined by L. Moisan in periodic plus smooth image decomposition.
Spot Extension Technique
An important issue in texture synthesis is to synthesize textures with arbitrary large size from a given sample.
Here we propose a practical method which solves this problem for RPN textures. This is done in extending the original texture sample into an equivalent spot having a larger size.
The method to extend the spot is quite simple: the periodic component of the original texture sample is pasted in a large constant image equals to the mean of the sample, with a previous variance normalization. The obtained image is then multiplied by a smooth transition function in order to attenuate the discontinuities along the inner frame of the spot.
Implementation
The whole algorithm for RPN texture synthesis consists in following four distinct steps.
- Compute the periodic component of the input image.
- Extend the periodic component into an equivalent spot of larger size using the spot extension technique described in the above section.
- Compute a random phase
. - Compute the RPN in adding the random phase
to the Fourier transform of each color channel.
If the output size is the same as the one of the original spot, step 2 is skipped and step 1 is reduced to the computation of the discrete Fourier transform of the periodic component (which saves two calls to the FFT algorithm).
Micro-textures
When photographed, remote homogeneous objects made of thin, small, or semitransparent objects create homogeneous regions in images. The geometric features and colors of the object's constituents are mixed, due to the blur inherent to image formation. The resulting image region is a micro-texture. Most homogeneous regions in any image should be micro-textures. The figure below shows an example. Five rectangles belonging to various homogeneous regions were picked in a high resolution landscape. These textures are displayed in pairs where the left is the original sub-image, and the right a simulation obtained by the RPN algorithm. With the exception of the clouds rectangle (which is obviously non-stationary), these samples and their simulated copies are usually considered perceptually equivalent by observers. Yet, not all homogeneous regions of an image are micro-textures. See below many examples, and the failure catalog as well.
| Some emulated textures taken from an high resolution landscape |
|---|
![]() |
Homogeneous regions in any image made of objects at large enough distance are micro-textures, and can be emulated by RPN. Here pebbles, wet sand, and various types of waves are correctly simulated.
The samples in the above image are micro-textures. However, not all image homogeneous parts are micro-textures.
Micro-textures and Macro-textures
Many images or image parts usually termed textures do not fit to the micro-texture requisites. Typically, periodic patterns with big visible elements, such as brick walls, are not micro-textures. More generally, textures whose building elements are spatially organized, such as the branches of a tree, are not micro-textures. Yet, each textured object has a critical distance at which it becomes a micro-texture. For instance, tiles at a close distance are a macro-texture, and are not amenable to phase randomization. The smaller tiles on roofs photographed at some distance can instead be emulated.
Examples
Below are some examples of satisfyingly well reproduced textures.
| Original image | RPN | ||
|---|---|---|---|
|
|
||
|
|
||
|
|
||
|
|
Rothko
A good case study can be made with Mark Rothko's paintings. This painter covers his canvas with homogeneous or slightly shaded homogeneous rectangles. As the examples below show, Rothko's micro-textures are extremely well emulated by RPN.
|
|||
| Rothko sample | RPN simulation | ||
|---|---|---|---|
|
|||
|
|||
Wood
Wood samples must be homogeneous in direction to be correctly emulated by RPN. Wood samples with knots or other conspicuous patterns fall logically in the failure catalog.
| Wood sample | RPN simulation |
|---|---|
|
![]() |
More Wood Examples
Fabric
These fabric samples were picked from several web sites. Only homogeneous fabrics, with no printed on patterns are treated. RPN turns out to work remarkably on jeans fabrics.
| Fabric sample | RPN simulation |
|---|---|
|
![]() |
More Fabric Examples
Carpet
These carpet samples are taken from a singe commercial website. Those with big patterns will be found in the failure catalog.
| Carpet sample | RPN simulation |
|---|---|
|
![]() |
More Carpet Examples
Brodatz
The Brodatz samples are a bit old-fashioned now, because they have no color and are small. A good proportion of them are micro-textures that are treated below. But many are actually macro-textures, or even shapes, that can hardly be termed textures. These examples will be mostly found in our failure catalog below.
| Brodatz sample | RPN simulation |
|---|---|
![]() |
More Brodatz Examples
Failure Catalog
Most failures are macro-textures. For instance:
- textures containing periodic geometric patterns with large period,
- textures containing strong edges, such as veins in marble or cracks in bark
- textures containing definite shapes, such as knots in wood or fruit or visible leaves in foliage
- strictly periodic patterns, even with small period, where phase shifts cause aliasing effects
- failure also occurs when the sample texture contains different dominant directions in different areas. Then these directions are mixed by the random sampler.
| Macro-texture sample | RPN simulation |
|---|---|
|
![]() |









































































































































































