Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Catalog · How the catalog works

Random project

XelImageFormats---50-image-formats-for-TPicture-webp-jp2-heif-avif-heic-psd...-

XelImageFormats - 50+ image formats for TPicture (webp, jp2, heif, avif, heic, psd...)

View on GitHub

Anyone may press Interesting, signed in or not. It helps others find this project.

Member rating

No ratings yet.

Sign in to rate this project.

README

XelImageFormats - a package for Delphi/Lazarus/Free Pascal with 50+ image formats for TPicture

Also available in Lazarus Online Package Manager. Add this package to your project and you can just load all those formats like this:

pascal
Image1.Picture.LoadFromFile('test.webp');

Getting 32bit TBitmap:

pascal
var Img: TXelGraphic;
    Bmp: TBitmap;
begin
  Img := Image1.Picture.Graphic as TXelGraphic;
  Bmp := Img.ToBitmap;

Saving to a format:

pascal
var Bmp: TBitmap;
    Webp: TWebpImage;
begin
  Webp := TWebpImage.Create;
  Webp.Assign(Bmp);
  Webp.SaveToFile('test.webp');
  Webp.Free;

Reading layers in PSD or TIFF

pascal
 var
   Psd  : TPsdImage;
   Layer: TBitmap;
   Count: Integer;
 begin
   Psd := TPsdImage.Create;
   Psd.LoadFromFile(FileName);
   Count := Psd.LayerCount;
   Layer := Psd.GetLayer(5);
   Layer.Free;
   Psd.Free;