Skip to content

img-to-html is a Python script that converts every pixel from an image, to a HTML element.

Notifications You must be signed in to change notification settings

pinguluk/img-to-html

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

img-to-html

img-to-html is a Python script that converts every pixel from an image, to a HTML element.

Installation

Download the imgtohtml.py script and install PIL

pip install pillow

Usage

imgtohtml.py -img IMAGE_DOT_EXTENSION -output FILENAME.html

Example

imgtohtml.py -img cat.jpg -output cat.html
imgtohtml.py -img fish.png -output fish.html

Preview

Cat Fish

TODO

  • Find a better way to implement background style (color) for each element, to reduce the file size
  • Improve the width (and height) of a pixel, when the adjacent pixels are the same, in order to remove repetitive pixels and improve file size

Checkout the other method I've made, using box-shadow

img-to-html-boxshadow

About

img-to-html is a Python script that converts every pixel from an image, to a HTML element.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages