PHP Classes

PHP Image to HTML: Display an image on a page using only HTML tags

Recommend this page to a friend!
     
  Info   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not yet rated by the usersTotal: 201 All time: 8,476 This week: 488Up
Version License PHP version Categories
image_to_html 1.0.0BSD License5HTML, PHP 5, Graphics
Description 

Author

This class can display an image on a page using only HTML tags.

It can take the path of an image file and scans its pixels to determine which colors they use, so it can generate HTML tags that when displayed on a Web page that show the same image but without using the image file.

The image can be converted in a different scale by providing a factor of how many times the displayed image will appear in terms of width and height when compared to the original image size.

Picture of chrys ugwu
  Performance   Level  
Name: chrys ugwu <contact>
Classes: 16 packages by
Country: Nigeria Nigeria
Age: 31
All time rank: 16807 in Nigeria Nigeria
Week rank: 193 Up8 in Nigeria Nigeria Down
Innovation award
Innovation award
Nominee: 4x

Details

php_image_to_html

converts image to html PITH SITE

for one match


require_once('ImageToHtml.php');
echo ImageToHtml::render('images/test.png');

/*
Note: acceptable images type: 'png, jpeg and gif'

//return rendered image with default attribute
echo ImageToHtml::render('images/test.png');
//return rendered image with default width multiplied by 4
echo ImageToHtml::render('images/test.png', 4);
//return rendered image with default height multiplied by 4
echo ImageToHtml::render('images/test.png', null, 4);
//return rendered image with default width and height multiplied by 4
echo ImageToHtml::render('images/test.png', 4, 4);



  Files folder image Files (7)  
File Role Description
Files folder imageimages (3 files)
Files folder imagesrc (1 file)
Plain text file index.php Example Example script
Plain text file LICENSE Lic. License text
Plain text file README.md Doc. Documentation

  Files folder image Files (7)  /  images  
File Role Description
  Image file test.png Icon Icon image
  Image file test2.jpg Icon Icon image
  Image file test3.png Icon Icon image

  Files folder image Files (7)  /  src  
File Role Description
  Plain text file ImageToHtml.php Class Class source

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:201
This week:0
All time:8,476
This week:488Up