Create jpg from byte array of raw image data

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a byte array of 24-bit image data. I want to compress the data as jpg
and write it to a stream. Is there any easy and fast way to do this in C#?

byte[] rawImageData = new byte[width*height *3];
// imagedata is filled with rgb pixel info

byte[] jpgImageData = ??? // compressed rawImageData (with header)

myStream.Write(jpgImageData);
 
Back
Top