c#:部分保存JPG. [英] c#: Saving JPGs in parts.

查看:86
本文介绍了c#:部分保存JPG.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我目前正在使用c#开源照片镶嵌软件( Sourceforge链接).该软件将大量小照片(平铺)缝合在一起,形成一个大图像.

由于最终的图像大小通常约为20k px乘以15k px,因此我只保存了如何在内存中排列图块的地图.要构建最终图像,我将按部分构建它,即以8行为单位(也可以是任何其他数字)构建.

对于bmp,首先可以写入bmp标头,然后将ARGB数据附加到此文件中,然后轻松地逐块保存该数据.

但是产生的bmp太大了,无法进一步处理(例如将其交给一些海报印刷公司).因此,我想将这些大图像另存为jpg在我的硬盘上.

现在的问题是,由于jpg被压缩,因此以块的形式写入数据似乎非常棘手(普通的Bitmap.Save()函数将首先将完整图像加载到内存中,因此不适用),因为写入的是未经压缩的纯RGB数据不会的.

在聚会中编写jpg的基本功能应该存在,因为据我所知,jpg的压缩算法适用于块或8x8 px.

我调查了几个图像库(FreeImage,GraphicsMagick,LibTiff.NET)以找到解决此问题的方法,但找不到任何方法. LibTiff基本上具有所需的功能,但仅适用于tiff图像格式.

非常感谢您的帮助!
Max

Hello all,

I am currently working on a c# open source photo mosaic software (Sourceforge Link). This software stitches together large amounts of small photos (tiles) into one big image.

Since the final image size is usually in the order of 20k px times 15k px, I am only saving a map of how to arrange the tiles in memory. To construct the final image, I am constructing it in parts, namely in band of 8 lines (can by any other number, too).

In the case of bmps, this data can then easily saved chunk by chunk by first writing a bmp header and subsequently appending the ARGB data to this file.

But the resulting bmps are far too big for further handling (e.g. giving them to some poster printing company). I would therefore like to save these big images as jpgs on my hdd.

The problem is now, that since jpgs are compressed, writing the data in chunks seems very tricky (the normal Bitmap.Save() function will load the full image into memory first and is therefore not applicable), since writing pure, uncompressed RGB data won''t do it.

The basic functionality of writing jpgs in party should exist, since as far as I know the compression algorithm of jpg works with chunks or 8x8 px.

I looked into several image libraries (FreeImage, GraphicsMagick, LibTiff.NET) to find solutions for this problem, but could not find any. LibTiff basically has the desired functionality, but only for the tiff image format.

Thanks a lot for your help!
Max

推荐答案

尝试这些链接,

http://x189.blogspot.com/2010/04/csharp- image-save-resize-binary-convert.html [ ^ ]
C#中的图像处理实验室 [ http://stackoverflow.com/questions/644519/generate-image-with-some-透明部分 [^ ]

希望有帮助,

如果有帮助,请投票..
谢谢
try these links,

http://x189.blogspot.com/2010/04/csharp-image-save-resize-binary-convert.html[^]
Image Processing Lab in C#[^]
http://stackoverflow.com/questions/644519/generate-image-with-some-transparent-parts[^]

Hope It helps,

please vote if it helps you..
thanks


这篇关于c#:部分保存JPG.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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