PHP Classes
elePHPant
Icontem

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

Recommend this page to a friend!
  Info   View files View files (7)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-09-22 (21 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 171 This week: 7All time: 8,532 This week: 49Up
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.

  Performance   Level  
Name: chrys ugwu <contact>
Classes: 7 packages by
Country: Nigeria Nigeria
Age: 26
All time rank: 22899 in Nigeria Nigeria
Week rank: 36 Up2 in Nigeria Nigeria Up
Innovation award
Innovation award
Nominee: 3x

 

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  
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  /  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  /  src  
File Role Description
  Plain text file ImageToHtml.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:171
This week:7
All time:8,532
This week:49Up