RetouchPRO

Go Back   RetouchPRO > Technique > Image Help
Register Blogs FAQ Site Nav Search Today's Posts Mark Forums Read Chat Room


Image Help Got a problem image? Don't know where to begin? Upload images and ask our users what they think or if they can help

Reply
 
Thread Tools
  #1  
Old 11-17-2006, 07:28 AM
Junior Member
 
Join Date: Nov 2006
Posts: 19
Red face Copy pixel by pixel

Hello!

I have little problem with a thing in PSP.
Im trying to make an macro that read pixel by pixel of an image, then save it to an file.

Ex. a 5x5 picture:

first pixel on first row should be copied to an 1x1 pixel file, named 01.jpg.
then the 2nd pixel on the first row should be copied to an 1x1 pixel file, named 02.jpg. And so on.. this is alot of work to do manually!
Is this even possible to achive with an psp macro??

The coolest thing would be that if psp can read the hexcode of each pixel in a picture, then save all the color codes starting from 1st row, 1st pixel
Then make an html file with a table where each TD represent one pixel.

Im wierd i know, but hey - cool if this works =)


Any skilled here that can help me?
Reply With Quote
  #2  
Old 11-17-2006, 09:30 PM
Kraellin's Avatar
Moderator
 
Join Date: Apr 2005
Location: somewhere over there
Posts: 8,750
Blog Entries: 4
Re: Copy pixel by pixel

welcome to RP, tobbe.

since no one else seems to have jumped in on this, let me just say that first, i'm not qute sure i'm getting exactly what you want here. if i read this right you want to save out the color code of every pixel into a separate image or something. you do realize that most images today, in uncompressed format, run into mega pixels, right? that would mean you would have over 1 million files from one image.

second, do you mean 'scripts' instead of macros?

and in this sentence, "where each TD represent one pixel." what is TD?

and if you want the hexcodes of the image, why not just get a hex editor and load the image in that and do a dump to a text file?
Reply With Quote
  #3  
Old 11-18-2006, 03:21 AM
NancyJ's Avatar
Senior Member
Patron
 
Join Date: Jun 2004
Posts: 729
Re: Copy pixel by pixel

A TD is a table cell in HTML Craig.

I dont know about PSP but its certainly possible to do in a web scripting language eg. PHP
Reply With Quote
  #4  
Old 11-18-2006, 07:24 AM
Kraellin's Avatar
Moderator
 
Join Date: Apr 2005
Location: somewhere over there
Posts: 8,750
Blog Entries: 4
Re: Copy pixel by pixel

ah, thanks nancy.
Reply With Quote
  #5  
Old 11-20-2006, 12:42 AM
Junior Member
 
Join Date: Nov 2006
Posts: 19
Re: Copy pixel by pixel

Hello!

I'll try to explain a little better

I want to extract either the color codes of each pixel, or copy pixel by pixel from source image to an new image. Yeah i understand that on large hires photos this is crazy, but i only gonna test it on smaller images

I´ve done a litte illustration to better show what i mean.

With macro i mean the "actions" u can make in PSP

And yes, with TD i mean a cell in a table.

The hexeditor is an idea, but i wonder if i can get the #xxxxxx value straight out from a file? Many diffrent formats, with compression and so on, this way can be har i think?

Thanks for concern!

Best Regards, Tobbe
Attached Images
File Type: jpg pixel.jpg (19.6 KB, 24 views)
Reply With Quote
  #6  
Old 11-20-2006, 09:20 AM
Senior Member
 
Join Date: Jun 2006
Posts: 129
Re: Copy pixel by pixel

I believe that you have a very good reason for this. So I created this filter for you. When you run it it creates "c:\tab.html" file with the "table" tag you need for the current image (right-click and edit to see the source).

I hope that's what you want... cause it wasn't that easy.

Enjoy
Attached Files
File Type: zip ImgToTable.zip (79.0 KB, 11 views)

Last edited by manta1900; 11-20-2006 at 12:30 PM.
Reply With Quote
  #7  
Old 11-21-2006, 12:18 AM
Junior Member
 
Join Date: Nov 2006
Posts: 19
Smile Re: Copy pixel by pixel

Quote:
Originally Posted by manta1900
I believe that you have a very good reason for this. So I created this filter for you. When you run it it creates "c:\tab.html" file with the "table" tag you need for the current image (right-click and edit to see the source).

I hope that's what you want... cause it wasn't that easy.

Enjoy
Hello!
Manta1900, i must say im really happy for the help! Thanks ALOT mate!!!
It works exactly as i had in mind!!

I must ask, how did you manage to fix this??! Its a plugin now and all

I´ll post some results here later!

And thanks again Manta!

Best Regards, Tobbe
Reply With Quote
  #8  
Old 11-21-2006, 04:00 AM
Senior Member
 
Join Date: Jun 2006
Posts: 129
Re: Copy pixel by pixel

Quote:
Originally Posted by tobbe_81
Hello!
I must ask, how did you manage to fix this??! Its a plugin now and all
I'm a computer programmer with photography (and computer programming) as a hobby. I like people who are searching deeper than just using their computer. I hope you will manage to create what you want. To create such filters use filtermeister. It's also a plug-in that you can create others.

I hope that helped you. If you need more help... just ask.


Waiting for your results...
Reply With Quote
  #9  
Old 11-21-2006, 04:46 AM
Cameraken's Avatar
Senior Member
 
Join Date: Feb 2005
Location: Lancashire (UK)
Posts: 1,122
Re: Copy pixel by pixel

Nice One Manta.

Here is part of my avatar

Code:
<td width="1" height="1" bgcolor="#33ff00"/>
    <td width="1" height="1" bgcolor="#33ff00"/>

    <td width="1" height="1" bgcolor="#33ff00"/>
    <td width="1" height="1" bgcolor="#33ff00"/>
    <td width="1" height="1" bgcolor="#33ff00"/>
    <td width="1" height="1" bgcolor="#0000ff"/>
    <td width="1" height="1" bgcolor="#0000ff"/>
    <td width="1" height="1" bgcolor="#0000ff"/>
    <td width="1" height="1" bgcolor="#33ff00"/>
    <td width="1" height="1" bgcolor="#33ff00"/>
    <td width="1" height="1" bgcolor="#0000ff"/>

    <td width="1" height="1" bgcolor="#0000ff"/>
    <td width="1" height="1" bgcolor="#33ff00"/>

Ken.
Reply With Quote
  #10  
Old 11-21-2006, 04:58 AM
Senior Member
 
Join Date: Jun 2006
Posts: 129
Re: Copy pixel by pixel

Just a warning: Internet Explorers will not function correctly (nor fast) with big "table images".

Happy coding!
Reply With Quote
  #11  
Old 11-21-2006, 05:45 AM
Godmother's Avatar
Senior Member
 
Join Date: Jun 2006
Posts: 814
Re: Copy pixel by pixel

When I read this thread I feel like a 4 year old
Reply With Quote
  #12  
Old 11-21-2006, 06:14 AM
Junior Member
 
Join Date: Nov 2006
Posts: 19
Re: Copy pixel by pixel

Quote:
Originally Posted by manta1900
I'm a computer programmer with photography (and computer programming) as a hobby. I like people who are searching deeper than just using their computer. I hope you will manage to create what you want. To create such filters use filtermeister. It's also a plug-in that you can create others.

I hope that helped you. If you need more help... just ask.


Waiting for your results...
Hey!

Ahh that sounds really fun! Nice to make own filters and so, cool

Im at work now, but ivé tested a few pics, works nice!
Altough if u take a little bigger images, IE goes waco ;D

I gonna laborate more with this when im @ home!

Thanks again mate

Have a nice day, Tobbe
Reply With Quote
  #13  
Old 11-21-2006, 06:24 AM
Senior Member
 
Join Date: Jun 2006
Posts: 129
Re: Copy pixel by pixel

Quote:
Originally Posted by Godmother
When I read this thread I feel like a 4 year old
It's OK Godmother. There is nothing wrong with you.... WE are the nerds! (and we like it)
Reply With Quote
  #14  
Old 11-21-2006, 06:56 AM
Junior Member
 
Join Date: Nov 2006
Posts: 19
Re: Copy pixel by pixel

Quote:
Originally Posted by manta1900
It's OK Godmother. There is nothing wrong with you.... WE are the nerds! (and we like it)
Couldn´t say it better my self =)

Did a quick test, look here: http://test.tobbe13.com/
Reply With Quote
  #15  
Old 11-21-2006, 07:06 AM
Senior Member
 
Join Date: Jun 2006
Posts: 129
Re: Copy pixel by pixel

Quote:
Originally Posted by tobbe_81
Did a quick test, look here: http://test.tobbe13.com/
Nice job Tobbe... though it is too slow!
Reply With Quote
  #16  
Old 11-21-2006, 07:11 AM
NancyJ's Avatar
Senior Member
Patron
 
Join Date: Jun 2004
Posts: 729
Re: Copy pixel by pixel

I have to wonder why you would want to do something like this - other than 'because you can'.
From a purely practical web perspective, the image is approx 1/10th of the size of the HTML needed to draw it with a table and as you've already found out - is impractical for larger images.
If you want imageless images on the web then you should look into the <canvas> tag for FF & Safari or SVG - pretty much anything except IE. Even with their newly released browser they're still behind the competition - just have to wait till IE 7.2
Reply With Quote
  #17  
Old 11-21-2006, 07:28 AM
Junior Member
 
Join Date: Nov 2006
Posts: 19
Re: Copy pixel by pixel

Quote:
Originally Posted by NancyJ
I have to wonder why you would want to do something like this - other than 'because you can'.
From a purely practical web perspective, the image is approx 1/10th of the size of the HTML needed to draw it with a table and as you've already found out - is impractical for larger images.
If you want imageless images on the web then you should look into the <canvas> tag for FF & Safari or SVG - pretty much anything except IE. Even with their newly released browser they're still behind the competition - just have to wait till IE 7.2
I just got this ideá one day when i was working on a hompage, just wanted to test if its possible to draw an image with tables.
then i realized that copy the color from pixel to pixel manually would be a huge job!! thats why did post here..

Thanks to manta it now works easy

So i have no really purpose for this, just wanted to se if this is possible, nerdy as i am

And yes, ivé noticed that this is unpractical with lager images, huuuge html file as result But hey, i atleast tried to do this

Hmm i must read more about the <canvas> tag, sounds interesting!
Reply With Quote
  #18  
Old 11-21-2006, 07:40 AM
NancyJ's Avatar
Senior Member
Patron
 
Join Date: Jun 2004
Posts: 729
Re: Copy pixel by pixel

From a nerdy point of view - doesnt it defeat the purpose to have someone do it for you?
Reply With Quote
  #19  
Old 11-21-2006, 07:46 AM
Senior Member
 
Join Date: Jun 2006
Posts: 129
Re: Copy pixel by pixel

Quote:
Originally Posted by NancyJ
From a nerdy point of view - doesnt it defeat the purpose to have someone do it for you?
NO! If you won't ask you'll never learn how to do it yourself!!!
If you are ashamed to... you'll just never learn (or reinvent the wheel over and over again). If you go to the test site of Tobbe and pass the mouse over the small smiley faces you'll see what he wanted to create! What he asked was the way to go there . To see if he can make it work... and he can (all by himself)!
Reply With Quote
  #20  
Old 11-21-2006, 07:52 AM
Junior Member
 
Join Date: Nov 2006
Posts: 19
Re: Copy pixel by pixel

Quote:
Originally Posted by NancyJ
From a nerdy point of view - doesnt it defeat the purpose to have someone do it for you?
My skills was not high enough to make this work other than do it manually, therefore i made this post - to get some help!

Then a friendly soul did more than just give me some suggestions, he did a filter for me, im really greatful for that!

At some point u much see your own limitations on your skills, so this was my last outpost..
Reply With Quote
  #21  
Old 11-21-2006, 07:55 AM
Junior Member
 
Join Date: Nov 2006
Posts: 19
Re: Copy pixel by pixel

Btw im working on trying to make some nice effects on the table aswell, but im at work atm, and have much to do =) But its coming more
Reply With Quote
  #22  
Old 11-21-2006, 08:07 AM
NancyJ's Avatar
Senior Member
Patron
 
Join Date: Jun 2004
Posts: 729
Re: Copy pixel by pixel

I'm not saying never ask for help when you need it - I was just saying that if you're doing something just for the sake of doing it - doesnt it defeat the point if you get someone else to do it for you?
Reply With Quote
  #23  
Old 11-21-2006, 08:24 AM
Junior Member
 
Join Date: Nov 2006
Posts: 19
Re: Copy pixel by pixel

Quote:
Originally Posted by NancyJ
I'm not saying never ask for help when you need it - I was just saying that if you're doing something just for the sake of doing it - doesnt it defeat the point if you get someone else to do it for you?
But as i tried to say before, i have worked alot with trying this to work automaticly, ive done several images there i have taken the color pixel by pixel and inserted to a table, manually...
I have also tried alot of ways to make this work by making actions in PSP, but without sucess

So thats why i posted this..Because i reach my limitation..
Reply With Quote
  #24  
Old 11-21-2006, 08:37 AM
NancyJ's Avatar
Senior Member
Patron
 
Join Date: Jun 2004
Posts: 729
Re: Copy pixel by pixel

I've done the same thing myself - ages ago - the point of what I was doing was an online photo mosaic generator but just for fun a drew a scaled down picture of the photograph
http://www.fearofbodd.com/headshot3.php
But since it has no practical application, using someone elses code would have defeated the object of doing it
Reply With Quote
  #25  
Old 11-21-2006, 08:48 AM
Junior Member
 
Join Date: Nov 2006
Posts: 19
Re: Copy pixel by pixel

Quote:
Originally Posted by NancyJ
I've done the same thing myself - ages ago - the point of what I was doing was an online photo mosaic generator but just for fun a drew a scaled down picture of the photograph
http://www.fearofbodd.com/headshot3.php
But since it has no practical application, using someone elses code would have defeated the object of doing it


Thats almost the same thing that i wanted to achive!

Soo, how did you make it work?
Reply With Quote
  #26  
Old 11-21-2006, 08:50 AM
NancyJ's Avatar
Senior Member
Patron
 
Join Date: Jun 2004
Posts: 729
Re: Copy pixel by pixel

Its really very simple - I give the script the name of the image - it reads the file and gets the rgb of every pixel and then prints a 1x1 table cell of that colour
Reply With Quote
  #27  
Old 11-21-2006, 08:52 AM
NancyJ's Avatar
Senior Member
Patron
 
Join Date: Jun 2004
Posts: 729
Re: Copy pixel by pixel

PHP Code:

<?

print "<table border=0 cellpadding=0 cellspacing=0 width=\"100%\">\n<tr>";

$image imagecreatefromjpeg("headshot2.jpg");

$xdim imagesx($image);

$ydim imagesy($image);

for (
$y 1$y <= $ydim-1$y++) {

for (
$x 1$x <= $xdim-1$x++) {

$rgb imagecolorat($image$x$y);

$r = ($rgb >> 16) & 0xFF;

$g = ($rgb >> 8) & 0xFF;

$b $rgb 0xFF;

print 
"<td width = \"0.32%\" height= \"0.32%\" style=\"background-color: rgb($r, $g, $b);\"></td>";

}

print 
"</tr>\n<tr>";

}

print 
"</tr></table>";

?>
Reply With Quote
  #28  
Old 11-21-2006, 08:53 AM
Senior Member
 
Join Date: Jun 2006
Posts: 129
Re: Copy pixel by pixel

Quote:
Originally Posted by NancyJ
I've done the same thing myself - ages ago - the point of what I was doing was an online photo mosaic generator but just for fun a drew a scaled down picture of the photograph
http://www.fearofbodd.com/headshot3.php
But since it has no practical application, using someone elses code would have defeated the object of doing it

Nice work nancy.

If you don't mind... I reassembled the picture and "retouched" it... just to prove that "imageless" images are not safe either (just a waste of time).
Attached Images
File Type: jpg nancy.jpg (67.8 KB, 11 views)
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Looking for a copy of Grain Surgery for Mac trans40 Software 4 06-26-2007 06:31 PM
NYTimes article: Looking Perfect, One Pixel at a Time mellyrose Photo Retouching 6 05-01-2007 07:24 AM
Copy and Paste nebgranny Photoshop Help 2 08-20-2005 09:47 PM
Convoluted Copy Protection Swampy Work/Jobs 7 04-16-2005 08:47 AM
BW Copy Neg vs. Scanning Test roger_ele Input/Output/Workflow 18 01-25-2003 10:17 PM


All times are GMT -6. The time now is 05:21 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.2
Copyright © 2008 Doug Nelson. All Rights Reserved