Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Hello; I am new to IDL and am having a problem figuring out how to accomplish an easy task. I have 8 images (png) that are 128x128. I would like to create one large image that is composed of four images in two rows with some sort of whitespace in between. Thats it. Any help at all would be greatly appreciated. Thanks FSD
Re: Creating an image as a sum of images
FSD writes: > Hey, thanks for the input. It sorta works but how do I read in eight > files and write them back out again with the window? I have several > thousand files and I need to run it seemslessly in the background. Well, clearly you are going to have to do it in a loop. :-) You can gather all the files in a directory with File_Search, figure out how many there are (keyword to File_Search), and loop through them 8 at a time. I would display them differently though. I would display 8 files like this: !P.Multi=[0,4,2] LoadCT, 0, /Silent Device, Decomposed=0 Erase, Color=255 FOR j=0,7 DO BEGIN ; read the image file and get the image on this line TVImage, image ENDFOR !P.Multi = 0 Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.dfanning.com/
In article <fhu40117oo2oat2gg4oi0tvm1bml66r2m1@4ax.com>, FSD <frank@digennaro-dot-com> wrote: > I am new to IDL and am having a problem figuring out how to > accomplish an easy task. I have 8 images (png) that are 128x128. > I would like to create one large image that is composed of four images > in two rows with some sort of whitespace in between. Thats it. Any > help at all would be greatly appreciated. Something like this, I think, ... file = ['png1', 'png2', ...] image = BYTARR(3, 4*128, 2*128) FOR j = 1, 0, -1 DO BEGIN FOR i = 0, 3 DO BEGIN ifile = i + j*4 png = READ_PNG(file[ifile]) image[*, i*128, j*128] = png ENDFOR ENDFOR Add whitespace as needed ... Cheers, Ken
"David Fanning" <davidf@dfanning.com> wrote in message news:MPG.1c6c3ea4c718278989901@news.frii.com... > FSD writes: > >> Hey, thanks for the input. It sorta works but how do I read in eight >> files and write them back out again with the window? I have several >> thousand files and I need to run it seemslessly in the background. > > Well, clearly you are going to have to do it in a loop. :-) >> !P.Multi=[0,4,2] > FOR j=0,7 DO BEGIN > ; read the image file and get the image on this line > TVImage, image > ENDFOR ahem, well, yes indeed, loops are good. Unless you have the 1998 version of tvimage, which doesn't quite work with p.multi :O -bob "Lets just say" [TM] I really should update some of those older routines ;)
R.G.Stockwell writes: > ahem, well, yes indeed, loops are good. > Unless you have the 1998 version of tvimage, which doesn't quite work with > p.multi :O Uh, time marches on... :-) Cheers, David -- David Fanning, Ph.D. Fanning Software Consulting, Inc. Coyote's Guide to IDL Programming: http://www.dfanning.com/