save jpg with lower bit depth (24 to 16 for instance) (C#)
问题 I need to convert 24- and 32-bits jpeg and png-files to a lower bit depth (16). I found some code to do this, but the resulting images keep the bit depth of the original file although there file size is lower. Image img = Image.FromFile(filePathOriginal); Bitmap bmp = ConvertTo16bpp(img); EncoderParameters parameters = new EncoderParameters(); parameters.Param[0] = new EncoderParameter(Encoder.ColorDepth, 16); bmp.Save(filePathNew, jpgCodec, parameters); bmp.Dispose(); img.Dispose(); ...