When to use PNG or JPG in iPhone development?

PNG’s are pixel perfect (non-lossy), and require very little extra CPU energy to display. However, large PNGs may take longer to read from storage than more compressed image formats, and thus be slower to display. JPG’s are smaller to store, but lossy (amount depends on compression level), and to display them requires a much more … Read more

How can I take a screenshot and save it as JPEG on Windows?

OK, after a lot of effort here’s the answer: int SaveJpeg(HBITMAP hBmp, LPCWSTR lpszFilename, ULONG uQuality) { ULONG *pBitmap = NULL; CLSID imageCLSID; EncoderParameters encoderParams; int iRes = 0; typedef Status (WINAPI *pGdipCreateBitmapFromHBITMAP)(HBITMAP, HPALETTE, ULONG**); pGdipCreateBitmapFromHBITMAP lGdipCreateBitmapFromHBITMAP; typedef Status (WINAPI *pGdipSaveImageToFile)(ULONG *, const WCHAR*, const CLSID*, const EncoderParameters*); pGdipSaveImageToFile lGdipSaveImageToFile; // load GdipCreateBitmapFromHBITMAP lGdipCreateBitmapFromHBITMAP = … Read more

Converting a byte array to PNG/JPG [closed]

You should be able to do something like this: using System.Drawing.Imaging; using System.Drawing; using System.IO; byte[] bitmap = GetYourImage(); using(Image image = Image.FromStream(new MemoryStream(bitmap))) { image.Save(“output.jpg”, ImageFormat.Jpeg); // Or Png } Look here for more info. Hopefully this helps.

Is it possible to tell the quality level of a JPEG?

You can view compress level using the identify tool in ImageMagick. Download and installation instructions can be found at the official website. After you install it, run the following command from the command line: identify -format ‘%Q’ yourimage.jpg This will return a value from 0 (low quality, small filesize) to 100 (high quality, large filesize). … Read more