I am working on a program which should generate a JPEG image file from a 2D array of pixels. I hava an idea to do it as a BMP image but I need to do it as a JPEG image. Can anyone explain with a sample code which would be easier for me to understand. I would appreciate any replies. Thank you very much