Need help with graphics with 280 million pixels

Just starting out? Need help? Post your questions and find answers here.
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

Need help with graphics with 280 million pixels

Post 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.
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
Konne
Enthusiast
Enthusiast
Posts: 434
Joined: Thu May 12, 2005 9:15 pm

Post 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...
Apart from that Mrs Lincoln, how was the show?
pjay
Enthusiast
Enthusiast
Posts: 251
Joined: Thu Mar 30, 2006 11:14 am

Post 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?
maw

Post 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:
Barney
User
User
Posts: 54
Joined: Wed Apr 26, 2006 12:01 pm

Post 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
josku_x
Addict
Addict
Posts: 997
Joined: Sat Sep 24, 2005 2:08 pm

Post by josku_x »

THat guy is wicked! I don't even think that a display of that size will be done in the future.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post 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.
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

280 million pixels

Post 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?
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: 280 million pixels

Post 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.
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

Post 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?
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Re: 280 million pixels

Post 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!!!
Dare2
Moderator
Moderator
Posts: 3321
Joined: Sat Dec 27, 2003 3:55 am
Location: Great Southern Land

Post 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?
@}--`--,-- A rose by any other name ..
PB&J Lover
Enthusiast
Enthusiast
Posts: 212
Joined: Fri Apr 22, 2005 2:07 pm
Location: U.S.A.
Contact:

Post 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.
-- DB

Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius — and a lot of courage — to move in the opposite direction.

Albert Einstein
pjay
Enthusiast
Enthusiast
Posts: 251
Joined: Thu Mar 30, 2006 11:14 am

Post 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.
User avatar
djes
Addict
Addict
Posts: 1806
Joined: Sat Feb 19, 2005 2:46 pm
Location: Pas-de-Calais, France

Post 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.
Post Reply