如何裁剪图像巨大 [英] How to crop huge image

查看:124
本文介绍了如何裁剪图像巨大的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要处理在C#中的大图像(20,000x20,000pixels)。直接打开这些图像是不是要走由于内存的限制的方式,但我想要做的就是图像分解成小片(裁剪)的内容。我一直在寻找一个第三方库,可能的伎俩,但至今没有结果。我试着和FreeImage的ImageMagick的,但他们不能打开20,000x20x000像素的图像。我怎样才能做到这一点?

I need to process large images (20,000x20,000pixels) in C#. Opening these images directly isn't the way to go because of memory limitations, but what I want to do is split the image into smaller pieces (cropping). I was looking for a 3rd party library that could the trick, but so far no result. I tried FreeImage and ImageMagick, but they cannot open an 20,000x20x000 pixel image. How can I achieve this?

推荐答案

我在工作中当前的项目包括图像查看器/分析能力超过16 GB加载图像的程序。你必须使用手动文件IO,拉头信息并创建子图象点播(或者,如果你处理图像,你可以创建一个单一的瓷砖和处理它在的地方)。很少库将会给您加载/ 20K通过图像(1.2GB的24 bpp的),并且做很少会与任何类似的性能做的那些修改20K的能力(如果这是一个问题)。

My current project at work consists of an image viewer/analyzing program capable of loading images in excess of 16 gb. You have to use manual file IO, pull the header information out and create your subimages on-demand (or if you're processing the image, you can create a single tile and process it in-place). Very few libraries are going to give you the capability to load/modify a 20k by 20k image (1.2gb at 24bpp) and the ones that do will rarely do so with anything resembling performance (if that is a concern).

这篇关于如何裁剪图像巨大的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆