LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create huge size PNG file with drawing?

As the title says, I want to create a huge PNG file.
But in this case, I know that the PC is running out of memory.
The pixel size of the image is about 200000x8000 and I only know the diameter of the circle and the center point where I want to draw it.

 

I would like a lot of advice on the above problem, and if you need an example I've tried before to solve the problem, I'll attach it.

 

Best Regards.

0 Kudos
Message 1 of 41
(2,353 Views)

Is size the only problem or do you have problems drawing a circle?

Is this black&white? Is the circle filled? How thick is the outline?

What's the purpose of this file? What program is supposed to open and render it later?

Does it have to be a single file or could you draw a series of tiles instead?

Are you planning to use the image tools and png write or are you planning to write all low-level file structures?

 

0 Kudos
Message 2 of 41
(2,324 Views)

That's almost 6 GBi (at 4 bytes per pixel). Is the PC running out of memory, or is LabVIEW running out of memory?

 

At least tell me you use 64 bit LabVIEW! That will help, but not solve things.

 

One way out would be to make a 200KX8K uncompressed PNG (if that exists, but they are quite flexible), and figure out a way to replace pixels in the file. That will be tricky, but might just work.

 

Or, make your own PNG generator that streams PNG data as it comes. That would require intimate knowledge of the PNG format, but the compression could probably be done streaming. Provided the data can be generated left to right, top to bottom, which is feasible for a circle (simply check if (x-x0)^2+(y-y0)^2>r^2 ).

 

Smells like computer generated holographics? Writing Fresnel patterns? Just curious..

0 Kudos
Message 3 of 41
(2,316 Views)

If you read http://www.libpng.org/pub/png/spec/1.1/PNG-Structure.html and compare to a simple uncompressed Picture as the one i attach, it should be possible to write a PNG file of your own, and then it should be fairly straiht forward.

 

 

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Download All
0 Kudos
Message 4 of 41
(2,301 Views)

I wandered if 0 compression means "no compression" or "lossless compression".

 

If 0 means "lossless", I'd still expect some deflating, or at least run length encoding to happen. But maybe not...

0 Kudos
Message 5 of 41
(2,286 Views)

@Yamaeda wrote:

If you read http://www.libpng.org/pub/png/spec/1.1/PNG-Structure.html and compare to a simple uncompressed Picture as the one i attach, it should be possible to write a PNG file of your own, and then it should be fairly straiht forward.

 

 


The old badge in your sig reminds me of how LV has cheapened the whole cert process by making the new badges look like unlocking an achievement in a video game.  My achievement (arguably) took a lot more effort than "Achievement Unlocked: Kill all your enemies in stealth mode." in game X.

 

I know that was the intent, but I didn't agree with it then; I don't agree with it now.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 41
(2,281 Views)

wiebe@CARYA wrote:

I wandered if 0 compression means "no compression" or "lossless compression".

 

If 0 means "lossless", I'd still expect some deflating, or at least run length encoding to happen. But maybe not...


As far as I know all PNG is lossless.  0 means no compression, just a few bytes for overhead.  No run length, no huffman tree, no LZ77.  1 means the least amount of compression, but still lossless.

0 Kudos
Message 7 of 41
(2,255 Views)

Method 0 is lossless, but still highly compressed using zlib tools. 

0 Kudos
Message 8 of 41
(2,228 Views)

No compression. My example vi also shows it if you look at the resulting file, it's pretty similar to a BMP.

Write png.png

 
G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 9 of 41
(2,204 Views)

@Yamaeda wrote:

No compression. My example vi also shows it if you look at the resulting file, it's pretty similar to a BMP.

You are not talking about the same as Altenbach. You talk about the compression input to the PNG VI, Altenbach is talking about the compression byte in the PNG IHDR chunk. The compression byte in the IHDR chunk has currently only one possible officially defined value and that is 0. It means that the data is compressed with the zlib deflate algorithme.

The actual IDAT chunks that contain the image data start with a zlib header that contains the compression flags which indicate the actual zlib compression method (standard requires here 8 for deflate algorithme), and compression level. This compression level is what the PNG VI allows to set.

 

Rolf Kalbermatter
My Blog
Message 10 of 41
(2,194 Views)