Page 1 of 3

Need help with graphics with 280 million pixels

Posted: Mon May 08, 2006 3:35 am
by PB&J Lover
I'm sort of new to doing stuff with graphics, but I need to create a square that is 28 million pixels by 14 million. These pixels will be changed in color by the action of algorythims.

Can I draw a graphic box that big and then just zoom in and out on it some how?

Any help would be appreciated.

Thanks.

Posted: Mon May 08, 2006 7:52 am
by Konne
I believe you are going to have problems with the maximal imagesize of PB. Maybe you could use pore than one Image.
'GrapahicBox' I guess you want so show the image on the screen (or create a Window). So you have to possibliys: Use an ImageGadget or a Screen (Openscreen). Zomming of the images schouldn't be a problem...

Posted: Mon May 08, 2006 9:17 am
by pjay
28 million pixels by 14 million: 392000000000000 pixel image
3 bytes per-pixel (24 bit color): 1176000000000000 bytes
/ 1024 to get Kbytes?: 1148437500000 kb
/ 1024 to get Megabytes: 1121520996 mb
/ 1024 to get Gigabytes: 1095235 gig

If your screen size is 1280x1024, this image would be 299072265 times bigger.

Now, i'm not sure my math is spot on here, but are you sure you want a 28m x 14m image?

Posted: Mon May 08, 2006 11:01 am
by maw
/ 1024 to get Terabytes: 1069 terabyte
/ 1024 to get Petabytes: 1 petabyte

I sure hope you have lots and lots of harddisks, because that is gonna swap :twisted:

Posted: Mon May 08, 2006 12:59 pm
by Barney
Hmm... Equator is 40.070 km long. Perhaps he wants a pic of equator at 1,431 m per pixel resolution :wink:

Barney

Posted: Mon May 08, 2006 1:25 pm
by josku_x
THat guy is wicked! I don't even think that a display of that size will be done in the future.

Posted: Mon May 08, 2006 1:43 pm
by djes
Stuff like this need special tools. I suppose it's why you're here : to develop them?
Could you be more precise about your project, we could help, but only if it is not wasting our time working on unrealistic things.

280 million pixels

Posted: Mon May 08, 2006 1:46 pm
by PB&J Lover
Sorry, I mean it would be an image 20 million by 14 million. We are doing a population study of the United States and want to represent each person by a "pixel" I know that zooming in and out will reduce the number of people I can see, but that's what I want.

I need to do the calculations on the whole 280 million, but I don't need that kind of resolution on the display. I don't know how to do the zooming. I can display a graphic image of 800 by 560 which has the same proportions, but I'd like to just display the full image and different resolutions and let the computer worry about how to do it.

Any ideas?

Re: 280 million pixels

Posted: Mon May 08, 2006 1:50 pm
by Trond
PB&J Lover wrote:Sorry, I mean it would be an image 20 million by 14 million.
You only need 782 311 gigabytes free memory for that.

Posted: Mon May 08, 2006 1:55 pm
by PB&J Lover
Not if I display the image at a lower resolution (like 800 by 560). I only need to do the calculations on the 280 as if they were all pixels, but I don't need to display all 280 million pixels.

I'd like to not have to do the reduction of resolution by brute force though. Is there a way to "display" 280 million pixels in at a 448,000 pixel resolution?

Re: 280 million pixels

Posted: Mon May 08, 2006 1:57 pm
by djes
PB&J Lover wrote:Sorry, I mean it would be an image 20 million by 14 million. We are doing a population study of the United States and want to represent each person by a "pixel" I know that zooming in and out will reduce the number of people I can see, but that's what I want.

I need to do the calculations on the whole 280 million, but I don't need that kind of resolution on the display. I don't know how to do the zooming. I can display a graphic image of 800 by 560 which has the same proportions, but I'd like to just display the full image and different resolutions and let the computer worry about how to do it.

Any ideas?
:shock: Are you sure of your calculations? Don't you mean 20 millions by 14 pixels instead of 20 millions by 14 millions pixels?
That's a HUGE difference!!!

Posted: Mon May 08, 2006 1:58 pm
by Dare2
Hi PB&J Lover,

If I understand what you said, then:

At any given time you will be seeing only a tiny subset (constrained by the screen wXh) and at any given time you will be doing only the work needed to resolve/render that image.

You won't need an image that big at all, just one the size of the screen which you populate with the "pixels" inside that bit.

Still sounds like a huge computing task to me, with overkill. What parameters are involved?

Posted: Mon May 08, 2006 2:07 pm
by PB&J Lover
We are doing a population study of the U.S. as it related to the spread of an infectious disease. The program is to develop slides that will be part of a demo shown to the National Institute of Health in Washington D.C.

I have to do the calculations for different scenerios based on 280 million population, but I don't need to display them all. I only need to display an image 800 by 560.

I've not done a lot with graphics in my PB programming so I don't know if there is an easy way to represent an "image" that is 280 million pixels, in only 448,000.

That's what I'm trying to do. Show how a disease might spread and represent it graphically with colored pixels.

Thanks.

Posted: Mon May 08, 2006 2:17 pm
by pjay
It'd be easier to scale it down a little - say, 1 pixel per 1000 populace.

It'll also be far less demanding when it comes to any 'disease spread' simulation & representation.

Posted: Mon May 08, 2006 2:22 pm
by djes
You need an image of only 16733*16734 (approximatively) to have 28 millions pixels.

As Pb (and windows) can only handle 8192*8192 images, you need 4 images of this size to handle all the population.

As pjay say, it would be easier (and faster) to make calculations on only a part of this (say 1 for 10 or 1 for 100), as visual representation will be exactly the same. Of course, if you have very specific computation needed, maybe you can try. Then you'll have to work on "subsets" if you want to be efficient.