comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Creating an image as a sum of images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Creating an image as a sum of images [message #42301] Thu, 03 February 2005 11:33 Go to next message
FSD is currently offline  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 Go to previous messageGo to next message
K. Bowman is currently offline  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 #42441 is a reply to message #42301] Thu, 03 February 2005 15:03 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
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/
Re: Creating an image as a sum of images [message #42442 is a reply to message #42301] Thu, 03 February 2005 14:48 Go to previous message
R.G.Stockwell is currently offline  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 Go to previous message
David Fanning is currently offline  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/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Creating an image as a sum of images
Next Topic: Object Graphics plot problem

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 04:57:16 PDT 2025

Total time taken to generate the page: 0.48214 seconds