bgrabitmap reduce quality lazarus / 39-Graphics ---------------------------------------------------------------------- xinyiman · 2019-12-28 17:59 Hi guys, I have a question. How can I reduce the quality of an image? I am looking for something similar to TJPEGImage.CompressionQuality But for bgrabitmap ---------------------------------------------------------------------- winni · 2019-12-28 19:06 Hi! JP(E)G  is a lossy file format. BGRA is a format to store, convert an show images. You can save a BGRAbitmap with low quality/high compression as a JPG, but who wants that? Winni ---------------------------------------------------------------------- lainz · 2019-12-28 21:42 In LazPaint is used this: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i FJpegStream := TMemoryStream.Create;    writer := TFPWriterJPEG.Create;    writer.CompressionQuality := JpegQuality;    FFlattenedOriginal.SaveToStream(FJpegStream, writer);    writer.Free; FFlattenedOriginal is a TBGRABitmap. uses   fpwritejpeg; ---------------------------------------------------------------------- circular · 2019-12-29 15:55 Indeed you need to pass the image writer as a parameter to specify the desired format options. Works as will with SaveToFile.