如何了解位图和JPEG文件的结构?

发布于 2024-08-26 08:34:02 字数 158 浏览 6 评论 0原文

我正在尝试编写一个非常简单的图像处理程序,以供娱乐和练习。我正在使用 System.Drawing。 ....Bitmap 类来处理图像并编辑其数据。但现在我想编写自己的位图对象实现类,并想知道 bmp 文件(和其他常见位图格式)及其元数据(索引、颜色系统等)如何存储在文件中,以及如何读取然后直接写?

I'm trying to write a very simple image processing program for fun and practice. I was using System.Drawing. ... .Bitmap class to handle images and edit their data. but now I want to write my own class of Bitmap object implementation and want to know how bmp files (and other common bitmap formats) and their meta-data (indexing, color system & etc) are stored in files, and how to read and write them directly?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

多孤肩上扛 2024-09-02 08:34:02

BMP 文件格式是一种简单的文件格式,创建自己的文件格式不会有什么困难。但对于 PNG、TIFF 或 JPEG 等压缩格式,您可能会遇到困难。没有人为这些编写编码器,它们有完善的参考实现。它们是用 C 语言编写的,C 语言是此类库的通用语言。

谷歌“libpng”、“libtiff”和“libjpeg”来找到它们。您需要一个 C 编译器将它们转换为可以 P/Invoke 的 DLL。

The BMP file format is a simple one, you'll have little trouble creating your own. But you'll hit the wall on a compressed format like PNG, TIFF or JPEG. Nobody writes an encoder for these, there are well established reference implementations for them. They are written in C, the universal language for libraries like these.

Google "libpng", "libtiff" and "libjpeg" to find them. You'll need a C compiler to turn them in a DLL that you can P/Invoke.

静水深流 2024-09-02 08:34:02

http://www.wotsit.org/ 是文件格式文档的好地方

BMP 非常简单,一个好的起点。我要做的下一个是 TIFF,然后您可以选择看起来最容易进行的压缩。跳转到 JPEG 的主要问题是了解如何进行压缩。

您可以查看主要格式的开源库以获取指导(libpng、libjpeg、libtiff)。

http://www.wotsit.org/ is a good place for file format documents

BMP is pretty simple and a good place to start. The next one I'd do is TIFF and then you can pick the compressions that seem easiest to do. The main issue with jumping to JPEG is understanding how to do the compression.

There are open-source libraries for the main formats that you can look at for guidance (libpng, libjpeg, libtiff).

野生奥特曼 2024-09-02 08:34:02

您正在查找有关 BMPJPEG 文件格式,以及 文件.Net 中的FileStream 类。

You're looking for the Wikipedia aricles on the BMP and JPEG file formats, and the File and FileStream classes in .Net.

灯角 2024-09-02 08:34:02

我认为维基百科是你的朋友;

Wikipedia is your friend I think;

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文