2017 © Pedro Peláez
 

library voronoi-obfuscate

Create an obfuscated version of a source image

image

dkerner/voronoi-obfuscate

Create an obfuscated version of a source image

  • Sunday, March 25, 2018
  • by dkerner
  • Repository
  • 2 Watchers
  • 1 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 13 % Grown

The README.md

This is currently a work in progress and not completly stable. API not yet final so new versions can break code.!, (*1)

voronoi-obfuscate

Create an obfuscated version of a source image by using a Voronoi diagram (see. https://en.wikipedia.org/wiki/Voronoi_diagram), (*2)

Getting Started

Maybe you feel like making "art" from your images or you just like your images obfuscated, (*3)

Input (200x200px):, (*4)

input, (*5)

Results:, (*6)

result, (*7)

Reduce Size to 100x100px, (*8)

result, (*9)

Non proportional resize to 400x100px, (*10)

result, (*11)

Non proportional resize to 100x400px, (*12)

result, (*13)

Installing

composer require dkerner/voronoi-obfuscate "@dev"

Usage

// create an obfuscated version of demo.jpg, store it as out.jpg 
// and create 500 points
VoronoiObfuscator::createFromImagePath('demo.jpg', 'out.jpg', 500);

// use config and resize the resulting image
$config = new ObfuscatorConfig();
$config->setImagePath('demo.jpg')
    ->setOutputPath('out.jpg')
    ->setCellCount(1000)
    ->setOutputSize(400,800);

VoronoiObfuscator::createFromConfig($config);

Or use an image resource as input and output, (*14)


$config = new ObfuscatorConfig(); // set input $imageRessource = imagecreatefromjpeg('demo.jpg'); $config->setInputResource( $imageRessource ) ->setCellCount(100) ->setOutputSize(100,100); $processedImageRessource = VoronoiObfuscator::processImage($config); // use it further however needed imagejpeg( $processedImageRessource, 'out_processed.jpg');

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details, (*15)

Acknowledgments

  • https://github.com/sroze with the sroze/PHP-Voronoi-algorithm example which was a great starting point and whose Nurbs classes are used at the moment
  • https://github.com/zippex who needed the image obfuscation

The Versions

25/03 2018

dev-master

9999999-dev

Create an obfuscated version of a source image

  Sources   Download

MIT

by DanielKerner