Sijun Forums Forum Index
Log in to check your private messages
My Profile Search Who's Online Member List FAQ Register Login Sijun Forums Forum Index

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
   Sijun Forums Forum Index >> Gallery/Finished Work
View previous topic :: View next topic  
Author   Topic : "[img'ish] maybe a bit differenent then the rest of the imgs"
sharpe
junior member


Member #
Joined: 28 Dec 2000
Posts: 21
Location: London, England

PostPosted: Tue Jan 02, 2001 5:55 pm     Reply with quote
I made a little java app that converts any jpg / gif from its original format.. into a html table...

its useless but kind of fun
the table is a huge load and a nice job for your web-browser to render..

but its fun. i think anyways..


original pic

Html-table version


------------------
- on top of the inbetween
Back to top
View user's profile Send private message Send e-mail
arniemg
member


Member #
Joined: 25 Dec 2000
Posts: 107
Location: Pensacola, FL, USA

PostPosted: Tue Jan 02, 2001 6:13 pm     Reply with quote
cool.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
Visigoth
Guest


Member #



PostPosted: Tue Jan 02, 2001 6:19 pm     Reply with quote
I'd have to say, that's the most unique "conversion" utility that I've ever seen... Good job man...But...What's it for...? hehe

------------------
Your car is a fiberglass penis extension.
Back to top
Plop
member


Member #
Joined: 13 May 2000
Posts: 275
Location: Nowhereville

PostPosted: Tue Jan 02, 2001 6:30 pm     Reply with quote
I wanted to make one for ages!
That is awsome.
Back to top
View user's profile Send private message
sharpe
junior member


Member #
Joined: 28 Dec 2000
Posts: 21
Location: London, England

PostPosted: Tue Jan 02, 2001 7:02 pm     Reply with quote
code if you want.. off topic sorry..
code:

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import java.awt.image.PixelGrabber;

class Pic2Table extends Frame {
int cellSize = 125;
public int xx,yy;
public Image image1;
public static void main(String[] args) {
File dir;
String Filename;
Filename = args[0];
dir = new File(".");
new Pic2Table(dir,Filename);
}

Pic2Table(File dir, String filename ) {

if (filename.toLowerCase().endsWith(".gif")
| | filename.toLowerCase().endsWith(".jpg"))
{
Component c = new ImageViewer(getToolkit().getImage(dir.getAbsolutePath() + File.separator + filename), filename);
c.setSize(300,300);
}
}
}


class ImageViewer extends Frame {
Image image;
int blue,red,green,alpha;
Integer myint;
String mystring;
char readme;
BufferedWriter out;
BufferedReader in;
ImageViewer(Image image, String name) {
super("Dette bildet blir konvertert");
this.image = image;
addWindowListener(new WindowEventHandler());
pack();
show();
}

public void handlesinglepixel(int x, int y, int pixel,int width) {
alpha = (pixel >> 24) & 0xff;
red = (pixel >> 16) & 0xff;
green = (pixel >> 8) & 0xff;
blue = (pixel ) & 0xff;
try
{
if (x==width-1){out.write("</tr>");}if (x==width-1){out.write("<tr height=4>");}
out.write("<td width = 4 style =\"background :#");
mystring = myint.toHexString(red);
if (mystring.length() ==1){mystring = "0" + mystring;}
out.write(mystring);
mystring = myint.toHexString(green);
if (mystring.length() ==1){mystring = "0" + mystring;}
out.write(mystring);
mystring = myint.toHexString(blue);
if (mystring.length() ==1){mystring = "0" + mystring;}
out.write(mystring);
// int temp = in.read();
// if (temp ==10 | temp == 13 | temp == 0){temp=45;}
// readme=(char)temp;
out.write(";\">.</td>");

}
catch (IOException e) {}

}

public void handlepixels(Image img, int x, int y, int w, int h) {
int[] pixels = new int[w * h];
PixelGrabber pg = new PixelGrabber(img, x, y, w, h, pixels, 0, w);
try
{
out = new BufferedWriter(new FileWriter("image.html"));
in = new BufferedReader(new FileReader("main2.java"));
out.write("<style>TABLE {letter-spacing:-0.4em;line-height: 30%; size:7;}</style><body><table cellpadding = 0 cellspacing =0>");
}
catch (IOException e) {}
try
{
pg.grabPixels();
}
catch (InterruptedException e) {}

for (int j = 0; j < h; j++)
{
for (int i = 0; i < w; i++)
{
handlesinglepixel(i, j, pixels[j * w + i],w);
}
}

try
{
out.write("</table></body>");
out.close();
in.close();
}
catch (IOException e) {}
}

public void paint(Graphics g)
{
g.drawImage(image, getInsets().left, getInsets().top, this);
}
class WindowEventHandler extends WindowAdapter
{
public void windowClosing(WindowEvent evt)
{
handlepixels(image, 0, 0, image.getWidth(null), image.getHeight(null));
dispose();
}
}
}




------------------
- on top of the inbetween
Back to top
View user's profile Send private message Send e-mail
OkkE
member


Member #
Joined: 04 Dec 2000
Posts: 87
Location: the Netherlands

PostPosted: Wed Jan 03, 2001 5:38 am     Reply with quote
Heh, cool.. but, umm.. what if i want to convert a pic that's 1600x1200 (72dpi).. hehe, then the HTML version would realy be huge, no?
Ahh well, it's a funny java-thing!
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sharpe
junior member


Member #
Joined: 28 Dec 2000
Posts: 21
Location: London, England

PostPosted: Wed Jan 03, 2001 5:58 am     Reply with quote
hehe , jeh the converted image would be huuuge. ofcourse its possible to make the table cells just 1px in size. then it would be the same size image wize. but file size would be hilarious..

its really just a complete waste of time... ;>
just something i tossed up over at the caribbean..

------------------
- on top of the inbetween
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Sijun Forums Forum Index -> Gallery/Finished Work All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2005 phpBB Group