简体   繁体   English

jpeg字节数组和位图字节数组之间的区别

[英]Difference between jpeg byte array and bitmap byte array

I am doing some image processing in C# and need help understand the differences between the raw data of different image formats. 我正在用C#做一些图像处理,需要帮助来了解不同图像格式的原始数据之间的差异。

I am capturing a 640x480, 30 frames a second RGB stream from a camera and I want to write this to disk as each frame is displayed and display on a WPF canvas object at the same time. 我正在从相机捕获一个640x480,第二帧RGB流30帧,并且我想在显示每一帧并同时在WPF画布对象上显示时将其写入磁盘。

Using Binary Writer I can write the byte[] data of the image to disk easily enough and I can easily convert this to a writeable bitmap to display in the canvas. 使用Binary Writer,我可以很容易地将图像的byte []数据写入磁盘,并且可以轻松地将其转换为可写位图以显示在画布中。

What I dont understand is this. 我不明白的是这个。 Is the raw data (byte[] imageData) of a JPEG different (smaller in size) to the raw data of a bitmap? JPEG的原始数据(byte [] imageData)与位图的原始数据是否不同(大小较小)? If it is, would it make more sense to convert every RGB image to JPEG then get the byte array for that JPEG and then write that information to disk? 如果是这样,将每个RGB图像转换为JPEG,然后获取该JPEG的字节数组,然后将该信息写入磁盘是否更有意义?

Apologies if that sounds like I have a simple view on this but I'm relatively knew to this type of programming. 道歉,如果听起来像我对此有一个简单的看法,但是我对这种类型的编程就相对了解了。 Thanks in advance for any help. 在此先感谢您的帮助。

“原始数据”(内存中的位)对于jpeg,bmp或png相同,它们仅针对图像的大小(宽度,高度)和像素格式(rgb,argb等)而不同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM