Creating an image as a sum of images [message #42301] |
Thu, 03 February 2005 11:33  |
FSD
Messages: 5 Registered: February 2005
|
Junior Member |
|
|
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 [message #42440 is a reply to message #42301] |
Thu, 03 February 2005 14:45   |
K. Bowman
Messages: 330 Registered: May 2000
|
Senior Member |
|
|
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
|
|
|
|
Re: Creating an image as a sum of images [message #42442 is a reply to message #42301] |
Thu, 03 February 2005 14:48  |
R.G.Stockwell
Messages: 163 Registered: October 2004
|
Senior Member |
|
|
"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 ;)
|
|
|
Re: Creating an image as a sum of images [message #42444 is a reply to message #42301] |
Thu, 03 February 2005 12:59  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
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/
|
|
|