[FW]: This code performs the rather esoteric function of converting an image file to a raw HTML page, using
tags with a cell for each pixel. The output is, of course, huge, and will crash some older browsers or systems. The only use I can think of this is if you had a hosting service which had tons of bandwidth but didn't support images, and ''really'' needed one.
proc htmlize {image_file save_to} {
set page [open $save_to w]
set source [image create photo -file $image_file]
puts -nonewline $page {}
foreach row [$source data] {
puts -nonewline $page {}
foreach color $row {
puts -nonewline $page " | "
}
puts -nonewline $page {
}
}
puts -nonewline $page {
}
close $page
}
[Category image]