Skip to content

Realise of a PHP script that can manipulate an image source and create images with a pixel style. Research and study with the use of the GD library.

License

Notifications You must be signed in to change notification settings

golendercaria/PixelArt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pixelArt

Realise of a PHP script that can manipulate an image source and create images with a pixel style. Research and study with the use of the GD library.

Documentation

fileName (string) : Source of image. nbrPoint (int) : The nunmber of pixel that you want to take in the picture. shape (string) : The shape, for the moment only rect is available. rangeSizeShape (array:int) : Range of size for the rect shape in pixel. minOpacity : The mininum opacity for shape, in percent. lowerizationLvl (int) : If this number is large then the large size will be rare borderLess (bool) : True, then the edge detection is done and similar color pixels are not taken, typically use when the images are on a solid background.

Required

PHP & GD

How to use

Load the script with URL of this

Basic example

//params for class
$params = array(
	"fileName"            => "pikachu.jpg",
	"nbrPoint"            => 10000,
	"shape"               => "rect",
	"rangeSizeShape"	  => array(0,50),
	"minOpacity"		  => 30,	//0 = hide | 100 = visible
	"lowerizationLvl"	  => 3,
	"borderLess"		  => true,
	"exportMode"		  => "display",	
	"randomColor"		  => false	
);

//launch object	
$imageRendering = new pixelArt($params);
$imageRendering->collectPixel();
$imageRendering->makingShape();

Animation

Use animated params for making gif picture.

$params = array(
	"fileName"            => "sangoku.jpg",
	"nbrPoint"            => 20000,
	"shape"               => "rect",
	"rangeSizeShape"	  => array(0,20),
	"minOpacity"		  => 30,	//0 = hide | 100 = visible
	"lowerizationLvl"	  => 2,
	"borderLess"		  => true,
	"exportMode"		  => "display",				
	"animated"		  	  => array(
		"nbrImage"		=> 3,
		"timerInterval"	=> 100
	)
);

//launch object	
$imageRendering = new pixelArt($params);
$imageRendering->makingAnimation();

Available shape

  • rect (rectangle)
  • triangle
  • diamond
  • sandglass

About

Realise of a PHP script that can manipulate an image source and create images with a pixel style. Research and study with the use of the GD library.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages