0

I have referred many codes from the sites for compressing bitmap using RLE compression but its not useful. Actually I am doing project in c# windows application to compress image into video format(.avi) by applying various compression by using avifi32.dll. By using this dll only Intel IYUV codec, Cinepak Codec, Microsoft Video 1 Compressions are working. But RLE is not supported. So I want to apply manually RLE Compression on bitmap.

Any help is appreciated.

Referred Sites:

rle compression algorithm c

http://www.codeproject.com/Articles/105595/RLE-Compression-for-Bitmaps

http://www.codeproject.com/Articles/9370/RunLength-Compression

http://www.codeguru.com/cpp/g-m/bitmap/compressing/article.php/c4929/RLE-RunLengthEncoding-Compression-Routine-in-MFC-for-256Color-Bitmaps.htm

Community
  • 1
  • 1
  • 1
    Simple RLE compression would very rarely work well on images, as there just aren't that many bytes repeated exactly. That's precisely why image-specific compression algorithms exist. – Jon Skeet Jan 19 '15 at 07:26
  • @JonSkeet: That depends on the subject of the image. When transferring monochrome content of embedded device touchscreen live (for remote management) RLE would be optimal (large strips of single color).; though actually since .bmp doesn't support RLE (or any for that matter) compression in 1-bpp images, they are sent uncompressed (overhead of most compression algorithms including headers etc caused the uncompressed 4KB of raw 1-bpp BMP to be superior size-wise to other lossless formats, with extra benefit of being negligible to CPU load.) – SF. Jan 19 '15 at 07:36
  • @SF.: That's true, but that's very niche. I think it's *reasonably* unlikely that that's the format the OP is interested in. – Jon Skeet Jan 19 '15 at 08:21
  • @JonSkeet: Reasonably, you don't use raw bitmaps but much more advanced graphics/video formats, especially for video (avi). That application is as niche as most applications of bmp. – SF. Jan 19 '15 at 08:28
  • @SF.: When you say "bmp" are you thinking of the specific file format, or just bitmaps in general? Note that the OP is trying to convert bitmaps *into* avi - I don't see anything particualrly niche about that. – Jon Skeet Jan 19 '15 at 08:29
  • @op: So basically, you want to make your own encoder? Unless you write a decoder too, nothing existing will support it, you know... no existing media players will magically know how to treat your data. That said, RLE _can_ be useful for compressing xor diffs between frames, since in relatively still sequences in the video those will generally have quite some open space. – Nyerguds Jan 17 '18 at 10:55

0 Answers0