1

I'm trying to stitch images which I get from a particular source at runtime. Each image is of Size 2500 x 2048. Ultimately I will be writing code to stitch more that 3000 images to get the resultant image which will have dimensions more than 80000 x 222000. The final stitched image will be very large in size. I will be giving this huge image to my client for futher processing.

My question is how we can load a bitmap object in C# WPF effciently for stitching the images and processing. However, creating a .NET 4.5 Console Application to test it out, I try to create a bitmap with the dimension mentioned above(80000 x 222000) it throws System.ArgumentException: Parameter is not valid.

I'm using 64-bit application. Or are there any third party libraries that we can use for image loading and processing?

user2299182
  • 109
  • 8
  • Tip: don't do this in-memory nor using GDI (`System.Drawing.*`). Instead create a stitch "map" in-memory and stitch the image data directly using a one-way `Stream`. Think about how programs like Adobe Photoshop worked in the days when computers had less RAM than the size of images they were working on (i.e. the early 1990s). – Dai Aug 11 '20 at 09:22
  • Actually a _bitmap_ image that has dimensions of 80,000x222,000 pixels would have a size of ~50GB. – 41686d6564 stands w. Palestine Aug 11 '20 at 09:42
  • The final image would have an image size varying from 5GB to 20GB – user2299182 Aug 11 '20 at 13:30
  • @user2299182 That is probably because you save it in a compressed format and not raw bmp. But the real image as it exists in your system memory to manipulate it would be uncompressed. If this is a 24-bit image, the real data will be 50 gb. If it's 32-bit, it's even up to 70gb. Unless this is an 8-bit image, you'll never be below 20gb. – Nyerguds Sep 23 '20 at 07:26

0 Answers0