9

I'm having difficulties when trying to save huge images with C# (I'm talking about over one gigabyte).

Basically I'm trying to do this in parts - I have around 200 bitmap sources and I need a way to combine them before or after encoding them to a .png file.

I know this is going to require lots of RAM unless I somehow stream the data directly from hard drive but I have no idea how to do this either.

Each bitmap source is 895x895 pixels so combining the images after encoding doesn't seem easy because C# doesn't let you create a bitmap with size of 13425 x 13425.

Blorgbeard
  • 101,031
  • 48
  • 228
  • 272
MythicManiac
  • 445
  • 1
  • 4
  • 11
  • You could look at [AForge](http://code.google.com/p/aforge/), as recommended by [this question](http://stackoverflow.com/questions/538746/what-libraries-are-available-for-manipulating-super-large-images-in-net?rq=1)'s answer – Blorgbeard Jun 25 '12 at 02:53
  • 2
    That is certainly pushing the limits of what Window's GDI+ can do. You may have to go 3rd party here. – vcsjones Jun 25 '12 at 02:54

1 Answers1

6

This PngCs library (disclaimer: I'm the author) lets you read and write huge PNG images line by line, so that you don't need to keep the full image in memory; perhaps you find it useful.

leonbloy
  • 73,180
  • 20
  • 142
  • 190