[SOLVED] Libwebp lazarus / 39-Graphics ---------------------------------------------------------------------- pcurtis · 2020-12-09 09:49 Hi All, How can I use libwebp64.dll (standalone) in my app to convert a jpg to webp? Thanks in advance. ---------------------------------------------------------------------- circular · 2020-12-09 14:44 BGRABitmap provides a reader/writer that uses this library. See BGRAReadWebP and BGRAWriteWebp units. You can as well use directly libwebp.pas unit from the package. ---------------------------------------------------------------------- pcurtis · 2020-12-09 15:04 OK Thanks. Any chance of a guideline how I can use it? I just was to save / convert 'x' to a webp with a quality of say 75 ---------------------------------------------------------------------- circular · 2020-12-09 16:52 Basically, here is how to do: - put the library in the same folder as your program (under Windows, on Linux the library is already installed) - add BGRABitmap to your project - write the code to convert In the code, create a TBGRABitmap from unit BGRABitmap, do LoadFromFile with the source and SaveToFile with the destination. It will guess from extensions the file format. If you want to specify parameters for the writer, you need to create a TBGRAWriterWebP from unit BGRAWriteWebP and set its properties and add it as an additional parameters to SaveToFile. ---------------------------------------------------------------------- pcurtis · 2020-12-10 09:08 Job done. Thanks. I tried it with 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 procedure TForm1.Button1Click(Sender: TObject);var  MyImage : TBGRABitmap;  MyDetails : TBGRAWriterWebP;begin  MyDetails := TBGRAWriterWebP.Create;  MyDetails.QualityPercent := 75;  MyDetails.Lossless := false;   MyImage := TBGRABitmap.Create;  MyImage.LoadFromFile('25606.jpg');  MyImage.SaveToFile('25606.webp', MyDetails);   MyDetails.Free;  MyImage.Free;end;