Skip to content

dkerner/voronoi-obfuscate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

voronoi-obfuscate

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

Getting Started

Maybe you feel like making "art" from your images or you just like your images obfuscated

Input (200x200px):

input

Results:

result

Reduce Size to 100x100px

result

Non proportional resize to 400x100px

result

Non proportional resize to 100x400px

result

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

$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

Acknowledgments

About

Create an obfuscated version of a source image by using a Voronoi diagram

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages