Convert IMG to HTML Table - PHP

This project received 15 bids from talented freelancers with an average bid price of $133 USD.

Get free quotes for a project like this
Project Budget
$30 - $250 USD
Total Bids
Project Description

The goal of this project is to have an Image to HTML table converter.

The PHP script will need to load an image from file and convert the image to a HTML table.

The HTML table cells will be individually colored to generate the picture in the file.

The PHP generated HTML table and its HTML code will be displayed as the final result.

The requirement is a web page to display only one button titled as "Load File"

When a user clicks on this button they are prompted to load an image file from their desktop.

BITMAP, GIF, JPG and PNG must be supported as valid file format types.

Once the user has chosen an image file, it needs to be loaded into memory with PHP and converted into a HTML table.

Every pixel in the image file should have a corresponding HTML table cell (<td> tag).

If the pixel in the image file is blue then the corresponding <td> tag should be blue as well.

<td> tags should have widths of 1px and heights of 1px.

<td> tag bgcolors should be set to the color found in the corresponding pixel.

For example, if the user loads a 2x2 image with the following colors:



Then the PHP script should produce the code shown below in a text field and also displayed as an actual HTML table.

<table width="2" border="0" cellspacing="0" cellpadding="0">


<td bgcolor="#FF0000" width="1" height="1"></td>

<td bgcolor="#00FF00" width="1" height="1"></td>



<td bgcolor="#0000FF" width="1" height="1"></td>

<td bgcolor="#FFFFFF" width="1" height="1"></td>



The Project will have 2 phases.

Phase 1 is to simply convert image pixels to corresponding <td> tags in a HTML table of same width and height as the image.

Phase 2 is to optimize the code so that <td> tags who have neighboring <td> tags with the same color are grouped together using colspan and/or rowpspans,

The entire project should be 1 PHP file.

Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online