Convert textfile to images

LP
Posted By
Liisa_Palomaa
Sep 7, 2006
Views
188
Replies
4
Status
Closed
Hi..

Do anyone know how you can convert a textfile to images?

I need some help to convert some text files to images. I am running a scanner and get some PIXEL values instead of images. I want to convert those text files to images in Photoshop. Is it possibly to do it using javascript? I would be very happy if anyone knows how to write a script. The text files can for example look like this (just bigger and random numbers):

1 2 3 4 5 6 7 8 9 10
2 3 4 5 6 7 8 9 10 11
3 4 5 6 7 8 9 10 11 12
4 5 6 7 8 9 10 11 12 13
5 6 7 8 9 10 11 12 13 14
6 7 8 9 10 11 12 13 14 15
7 8 9 10 11 12 13 14 15 16
8 9 10 11 12 13 14 15 16 17
9 10 11 12 13 14 15 16 17 18
10 11 12 13 14 15 16 17 18 19
11 12 13 14 15 16 17 18 19 20
12 13 14 15 16 17 18 19 20 21
13 14 15 16 17 18 19 20 21 22
14 15 16 17 18 19 20 21 22 23
15 16 17 18 19 20 21 22 23 24
16 17 18 19 20 21 22 23 24 25

PS. I use Photoshop CS2 for Windows

Please help me!! I am a n00b so please write it very simple.

Thanks
Liisa

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

CN
Cybernetic Nomad
Sep 8, 2006
I am running a scanner and get some PIXEL values instead of images.

Might it not be easier to let us know what kind of scanner you are running and with what software?

Perhaps someone here has experience with it and can help you operate it "properly" (by which I mean getting images ratehr than text files)

If you really need a script, I’d look at the Photoshop Scripting forum, just next door:

<http://www.adobeforums.com/cgi-bin/webx?13@@.3bbf2765>
LP
Liisa_Palomaa
Sep 12, 2006
Hi….

Thanks for your reply Cybernetic Nomad. The reason why I (or my supervisor- I am a student at a forest research company) want to do this- is that it is more easy to find the dive and grain angle- when you use the textfiles- compared with the images. So yes I need to convert the textfiles.

This is the things I want to do with the textfiles:

1.Read textfiles 1 and 2 and convert to image
2.Match image1 and image 2 – resize them by for example interpolating pixelvalues for the images. They have different sizes- but are data for the same board.
3. Take the images from step 2 and combine as channels (in Photoshop) in a single image.
4. Read in RGB data from RGB images (from step 3) and merge them to a final image.

//Liisa Palomaa
MD
Michael_D_Sullivan
Sep 12, 2006
Liisa, I think you are talking about multiple scans of the same section of a board of wood under different scanning conditions (perhaps different lighting), but I don’t understand what you mean by the "dive and grain angle". A better description of what you are looking at will help us try to come up with ways to deal with it.

It isn’t clear what the text files represent, or how you are converting these to an image. What is the output of the scan, in textual numbers? I.e., are these numbers RGB (red, green, blue) or greyscale? It seems like you will only have RGB images in step 3. Does this mean that you have scans in different colors (as greyscale images) in separate files, with separate resolutions? What is the bit depth of the images (are they 8 bits, i.e., 0-255, or are they 16 bits, i.e., 0-65535, or something else)? If they are RGB, are the R, G, and B numbers for a given scan pixel in that order, or is the output providing a full scan line in R, then in G, then in B, or is the entire image produced in R, then G, then B? The odds are that a relatively simple processing algorithm can be developed for any of these, but we need to know which one.

It sounds like you have monochrome scans of a given board in various colors (perhaps R, G, and B, but perhaps others instead/as well), and that these scans are not perfectly aligned with each other, and you are seeking to align them and convert them to channels in an appropriate manner. If this is the case — or your situation is different — please give us the facts that will let us help you.
LP
Liisa_Palomaa
Sep 14, 2006
Hi….

The machine I am using for the scanning consists of a T2(and T1) sensor and a camera. #The T2 sensor takes a photo of a laser spot in black and white. Then it does some processing to determine grain angle and dive angle. (Grain angle= wood fibres do not often grow parallell to the direction of the stem- the deviation is called grain angle. When a narrow beam of light strikes a wood surface, a part of the light penetrates into the outermost layers of the fibers where it is scattered and conducted, better int the direction of the fibres than across them.)
#The T2 sensor outputs results in 2 text files *_results.txt and * _segments.txt. #The RGB camera takes a colour photo of a small section of board. These photos can be stitched together to provide a picture of the whole board. #The bit depth of the images are 8 bits.

I hope that this will help you to understand what I want to do. I have no idea how to convert textfiles to images- just that they must be able to open in Photoshop- and I would be happy if it is possble to do it with javascript.

Thanks.

//Liisa

Must-have mockup pack for every graphic designer 🔥🔥🔥

Easy-to-use drag-n-drop Photoshop scene creator with more than 2800 items.

Related Discussion Topics

Nice and short text about related topics in discussion sections