Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Image-2-HTML Converter 1.0

Author
Message
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 25th Oct 2003 19:29 Edited at: 26th Oct 2003 08:42
Hello Everyone...
Ok, here is a little project I've been working on for a little while, which is free for anyone to use as they wish (but it is only an .exe file).


What Image-2-HTML Converter 1.0 does;

1) The user specifies an image to be converted to HTML code.

2) The image is then read and all relevant colour data is extracted and saved into HTML format, as a table (This may seem odd, but read on, it'll become clearer)

3) This table is then read by the user's browser and what is displayed is the original image.


How Image-2-HTML Converter 1.0 works;

1) The user-specified image is read, pixel by pixel from within the exe file, and then each pixel's colour value is converted to Hex form.

2) This, along with the relevant commands for creating Tables in HTML is writen to the user-specified file.

3) This ultimatly creates a table that has as many rows as the original image has pixel-width, and has as many columns as the original image has pixel-height.

4) Each cell of this table is 1x1 pixel's in size, therefore, each cell represents one pixel of the original image.

5) Each one of these 1x1 pixel sized cells is coloured according to the Hex values that were calculated from the original image.

6) This goes together to create a table that has cells of one pixel in size that are coloured corresponding to the same pixel int he original image.

7) Therefore, what you see is, essentially the original image, yet, is actually a table...


The reason for Image-2-HTML Converter 1.0;

Ever had someone steal your image that you created and placed on your website?
Ever had anyone right-click saving images that they shouldn't be?

Well, Image-2-HTML Converter 1.0 is your answer...
because of the unique way that the "image" is shown (as a table) it is therefore *impossible* to right-click save the image directly from the server. Also, because there is no need for the original image once it has been converted to the table, there is no need to upload image files to your server...


A few notes about Image-2-HTML Converter 1.0;

1) Because of the way this program works (creating a text-based table from a pixel image), the resulting html document will always be larger than the original image, this may seem to be a drw-back, but, is in fact, not a major concern.

2) Because of this, i *strongly* recomend against using images any larger than ~300x300 pixels in size.
An easy way to work out the resulting HTML document's size in Kb is to use this calculation:

As you can see from the above calculation, an image that is 1024x768 pixels will result in a HTML document that is ~23,000Kb in size, compared with the original image size that would be ~500Kb in size.

3) The image you specify must be in the same folder as the exe.

4) The download is ~890Kb

5) If i get enough requests for the source, i will post it, otherwise, it will remain confidential.

That's all for now.

Feel free to post your comments (No flames please).
Thanks and Enjoy.



Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 26th Oct 2003 08:43
Ahemm..... *bump*

C'mon people, give me some feed-back here, im dying to know what you think...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
elVee
21
Years of Service
User Offline
Joined: 4th Oct 2003
Location:
Posted: 26th Oct 2003 21:19 Edited at: 26th Oct 2003 21:22
Im checking it out now.


@edit: I cant open it in winzip. It says its not a valid archive or something.
BatVink
Moderator
22
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 26th Oct 2003 22:19
I have one small piece of feedback...[Print Screen]. You won't be able to stop anyone doing that. Granted, it is more awkward, so you will stop the casual grafix hoarder, but if someone wants the image, they will have it.

BatVink (formerly StevieVee)
http://facepaint.me.uk/catalog/default.php
Rknight
21
Years of Service
User Offline
Joined: 25th Sep 2003
Location: NJ
Posted: 26th Oct 2003 22:51
Wow. A moderate sized picture sure stopped my browser cold for awhile, even adjusting the window.

Nice thing to be able to do though.

Here's one source code request. Might teach me a thing or two about HTML and working with image files to see it.
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 27th Oct 2003 04:20 Edited at: 27th Oct 2003 09:11
Hmm, ok, im feeling generous...
Ill upload the source when i get home (in about 5 hrs)...

Its not much, i think its all of about 20 lines (excluding the input commands at the start)...

The issue where it stops the browser, is because your browser has to read the entire table, and adjust its position every time the page is changed/viewed.

The Printscreen was a thought, yes... I knew that that would come up, but i figured, "What the hell" i like htis program that i made, and im gonna let the world know!"

@elVee:
Once i upload the source, you can use that...
Or i might even upload the exe on its own, but it will be a bigger file.
And also, i suggest using anything BUT winzip to unzip it, use WinRar or WinAce or Power Archiver, they are all much better than Wnizip IMO.

[EDIT] Ok, the source, the uncompressed exe and the zipped exe are all now available at the same place as is above...
The source is up for both DBPro and DBC, and all the file sizes are listed (for those of you not using broadband connections)
Enjoy.
[/EDIT]


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 30th Oct 2003 03:34
*cough*


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
David T
Retired Moderator
22
Years of Service
User Offline
Joined: 27th Aug 2002
Location: England
Posted: 30th Oct 2003 12:00
I'll d/l it and tell you what i think.

"The trouble with the French is that they have no word for 'entreprenuer'" - Pres. George W Bush
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 30th Oct 2003 12:50
Thanks man...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 4th Nov 2003 08:47
*cough*

It's dead in here...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy
Rknight
21
Years of Service
User Offline
Joined: 25th Sep 2003
Location: NJ
Posted: 4th Nov 2003 11:05
Ah, I see the thread's been updated. Thanks for the source posting. It was simpler than I thought it'd be!
Jess T
Retired Moderator
21
Years of Service
User Offline
Joined: 20th Sep 2003
Location: Over There... Kablam!
Posted: 4th Nov 2003 11:20 Edited at: 4th Nov 2003 11:21
Yeah, not too much in the way of "hard" coding, it's just a matter of making sure you get the table tags right for the HTML, otherwise, nothing in the HTML page will work (if you get even one of the tags wrong when wrighting the file, the error is repeated throughout the file and therefore stuffs everythign up, lol)...

Thanks to Rknight for showing at least some interest in my little project...

Thanks to everyone else who opened the thread and thought, damn, that's a long post, scr*w that *close*...


Team EOD :: Programmer/Logical Engineer/All-Round Nice Guy

Login to post a reply

Server time is: 2025-05-21 09:23:50
Your offset time is: 2025-05-21 09:23:50