PHP Classes

How Can PHP Generate Noise Images Using the SimpleX Noise Algorithm: Generate noise values using the SimpleX algorithm

Recommend this page to a friend!
  Info   View files Example   View files View files (14)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog (1)    
Last Updated Ratings Unique User Downloads Download Rankings
2022-08-30 (18 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 37 This week: 14All time: 10,503 This week: 7Up
Version License PHP version Categories
simplexnoise 1.0.0BSD License5Algorithms, PHP 5, Graphics
Description Author

This package can generate noise images using the SimpleX algorithm.

It can take several parameters to configure the generation of noise values like the zoom level, octaves, persistence, and elevation.

The class can return the noise level values in different positions given the X and Y coordinates of the points in the noise plane.

Innovation Award
PHP Programming Innovation award nominee
August 2022
Nominee
Vote
Noise is a signal that can cause certain disturbances. It is often associated with sound but can also be associated with an image.

Noise images can be helpful. For instance, you may use noise images to generate CAPTCHA validation images that may obfuscate a picture with text that the user needs to recognize.

The noise image can help obfuscate the text to make it harder for robots to recognize the text while humans may be able to identify it.

This package can generate noise data for creating noise images for CAPTCHA validation or other purposes.

It uses the SimpleX noise algorithm. This algorithm has several advantages over classic forms of generating noise like the Perlin algorithm.

For instance, the simplex algorithm requires less computing power to create noise.

Manuel Lemos
Picture of Vitalij Mik
  Performance   Level  
Name: Vitalij Mik <contact>
Classes: 5 packages by
Country: Germany Germany
Innovation award
Innovation award
Nominee: 4x

Details

PHP SimplexNoise

this is just a php version of the original code at

https://weber.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf

Installation

composer require blackscorp/simplexnoise

Usage

$noise2D = new \BlackScorp\SimplexNoise\Noise2D();
$greyValue = $noise2D->getGreyValue($locationX, $locationY);
var_dump($greyValue); //a value between 0 and 255

Examples

for more examples and details please take a look at examples folder. just copy more png images into exampels/gradients in order to create cool effects

currently only 2D is implemented

  Files folder image Files  
File Role Description
Files folder imageexamples (2 files, 1 directory)
Files folder imagesrc (2 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file LICENSE Lic. License text
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  examples  
File Role Description
Files folder imagegradients (6 files)
  Accessible without login Plain text file generate.php Example Example script
  Accessible without login Plain text file index.php Aux. Auxiliary script

  Files folder image Files  /  examples  /  gradients  
File Role Description
  Accessible without login Image file example1.png Icon Icon image
  Accessible without login Image file fire-gradient.png Icon Icon image
  Accessible without login Image file greyscale-inverted.png Icon Icon image
  Accessible without login Image file greyscale.png Icon Icon image
  Accessible without login Image file land-and-sea.png Icon Icon image
  Accessible without login Image file tropical.png Icon Icon image

  Files folder image Files  /  src  
File Role Description
  Plain text file Noise2D.php Class Class source
  Plain text file NoiseData.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:37
This week:14
All time:10,503
This week:7Up
For more information send a message to info at phpclasses dot org.