Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# Saving huge images

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.

like image 890
MythicManiac Avatar asked Jun 25 '12 02:06

MythicManiac


Video Answer


1 Answers

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.

like image 92
leonbloy Avatar answered Sep 20 '22 18:09

leonbloy