PHP Classes

PHP Photo Wall Gallery: Convert images to ASCII characters or photo walls

Recommend this page to a friend!
  Info   View files Example   Demos   View files View files (13)   DownloadInstall with Composer Download .zip   Reputation   Support forum (3)   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 72%Total: 414 This week: 1All time: 6,452 This week: 560Up
Version License PHP version Categories
photo-wall-gallery 1.10GNU General Publi...5PHP 5, Graphics
Description 

Author

This class can convert images to ASCII characters or photo walls.

It can perform several types of operations to images in the JPEG, GIF, or PNG formats applying filters or cropping and resizing the images.

The class can also convert the images to render them as a grid of ASCII characters, as well create photo walls from them with given width and height.

Innovation Award
PHP Programming Innovation award winner
April 2016
Winner


Prize: One downloadable copy of CodeLobster Professional
Photo walls are useful for Web sites that need to show many images at once in a Web page.

This class can generate photo wall images composed from groups of other images that may have their sizes adjusted to align better in the photo wall.

Manuel Lemos
Picture of andrea battellocchi
  Performance   Level  
Name: andrea battellocchi is available for providing paid consulting. Contact andrea battellocchi .
Classes: 2 packages by
Country: Italy Italy
Age: 48
All time rank: 2998113 in Italy Italy
Week rank: 416 Up16 in Italy Italy Up
Innovation award
Innovation award
Nominee: 2x

Winner: 1x

Example

<?php
ini_set
('memory_limit', '32048M');
include(
"class/im.class.php");

$w = 800;
$h = 600;
$c = 0;
/*end default*/

/*override if passed from $_REQUEST*/

foreach ($_REQUEST as $k=>$v)
 ${
$k} = $v;

$im = new ImageManipulate();
$q=0;
foreach (
glob("{media".DIRECTORY_SEPARATOR."*.jpg,media".DIRECTORY_SEPARATOR."*.jpeg,media".DIRECTORY_SEPARATOR."*.gif,media".DIRECTORY_SEPARATOR."*.png}",GLOB_BRACE) as $filename)
 {
     ${
"filename".$q} = $filename;
    
$q++;
 }


 
$ra = rand(0,$q-1);
 
$filename = ${"filename".$ra};
 
$ext = strtolower(substr(strrchr($filename, '.'), 1));
 
header('Content-Type: ' . $im->extension_to_image_type($ext));

 
$im->CachePath = (__DIR__).DIRECTORY_SEPARATOR . "im_cache".DIRECTORY_SEPARATOR;

 
$im->resize($filename,$w,$h,$c);

?>



Details

ImageManipulate is a PHP class to manipulate images this class can Create wall with random file from media dir (you can provide: width, height,rows,columns) Create horizontal stripe with random file from media dir (you can provide: width, height) Create vertical stripe with random file from media dir (you can provide: width, height) Create Ascii image with random file from media dir (you can provide: width, height,chars and much more) Crop to fit explicit width and height examples (you can provide: width, height) Apply filter to image like: IMG_FILTER_NEGATE: Reverses all colors of the image. IMG_FILTER_GRAYSCALE: Converts the image into grayscale. IMG_FILTER_BRIGHTNESS: Changes the brightness of the image. Use arg1 to set the level of brightness. The range for the brightness is -255 to 255. IMG_FILTER_CONTRAST: Changes the contrast of the image. Use arg1 to set the level of contrast. IMG_FILTER_COLORIZE: Like IMG_FILTER_GRAYSCALE, except you can specify the color. Use arg1, arg2 and arg3 in the form of red, green, blue and arg4 for the alpha channel. The range for each color is 0 to 255. IMG_FILTER_EDGEDETECT: Uses edge detection to highlight the edges in the image. IMG_FILTER_EMBOSS: Embosses the image. IMG_FILTER_GAUSSIAN_BLUR: Blurs the image using the Gaussian method. IMG_FILTER_SELECTIVE_BLUR: Blurs the image. IMG_FILTER_MEAN_REMOVAL: Uses mean removal to achieve a "sketchy" effect. IMG_FILTER_SMOOTH: Makes the image smoother. Use arg1 to set the level of smoothness. IMG_FILTER_PIXELATE: Applies pixelation effect to the image, use arg1 to set the block size and arg2 to set the pixelation effect mode.

  demo pageExternal page  

Open in a separate window

  Files folder image Files  
File Role Description
Files folder imageclass (1 file)
Files folder imagemedia (3 files)
Plain text file asciize.php Example interface to class to create ascii image
Plain text file filter.php Example interface to class to apply filter to image
Plain text file filter_alternate.php Example GLOB_BRACE Workaround
Accessible without login Plain text file index.html Data example page
Accessible without login Plain text file read.me Doc. readme file
Plain text file resize_size.php Example interface to class to resize image
Plain text file resize_size_alternate.php Example GLOB_BRACE Workaround
Plain text file wall.php Example interface to class to create photowall and stripe
Plain text file wall_alternate.php Example GLOB_BRACE Workaround

  Files folder image Files  /  class  
File Role Description
  Plain text file im.class.php Class class/im.class.php

  Files folder image Files  /  media  
File Role Description
  Image file 1.jpg Photo media/1.jpg
  Image file 2.jpg Photo media/2.jpg
  Image file 3.jpg Photo media/3.jpg

 Version Control Unique User Downloads Download Rankings  
 0%
Total:414
This week:1
All time:6,452
This week:560Up
User Ratings User Comments (2)
 All time
Utility:91%StarStarStarStarStar
Consistency:87%StarStarStarStarStar
Documentation:87%StarStarStarStarStar
Examples:87%StarStarStarStarStar
Tests:-
Videos:-
Overall:72%StarStarStarStar
Rank:202
 
Excellent package with brilliant support
7 years ago (Stephen Layton)
77%StarStarStarStar
Witty class.
7 years ago (pippo calzettoni)
80%StarStarStarStarStar