Recent

Author Topic: Reading and writing AVIF and HEIC in Lazarus  (Read 991 times)

Tomxe

  • New Member
  • *
  • Posts: 40
Reading and writing AVIF and HEIC in Lazarus
« on: February 06, 2025, 02:34:13 pm »
Hello!
A fresh unit, just released under MIT license:
https://github.com/Xelitan/AVIF-and-HEIC-for-Delphi-Lazarus/

Example:
Code: Pascal  [Select][+][-]
  1. Image1.Picture.LoadFromFile('test.heic');
  2. Image1.Picture.LoadFromFile('test.avif');

Saving:
Code: Pascal  [Select][+][-]
  1. var a: TAvifImage;
  2.      h: THeicImage;
  3. begin
  4.   Image1.Picture.LoadFRomFile('test.bmp');
  5.  
  6.   a := TAvifImage.Create;
  7.   a.Assign(Image1.Picture.Bitmap);
  8.   a.SaveToFile('test1.avic');
  9.   a.free;
  10.  
  11.   h := THeicImage.Create;
  12.   h.Assign(Image1.Picture.Bitmap);
  13.   h.SaveToFile('test1.heic');
  14.   h.free;
  15. end;
  16.  

All input welcome!

Okoba

  • Hero Member
  • *****
  • Posts: 616
Re: Reading and writing AVIF and HEIC in Lazarus
« Reply #1 on: February 09, 2025, 08:25:04 am »
Thank you Tomxe! For these and FLIF. Great to have the ability. You should check with @circular, as they may want to add these to BGRABitmap. Post on the forum https://forum.lazarus.freepascal.org/index.php/board,46.0.html

Boleeman

  • Hero Member
  • *****
  • Posts: 842
Re: Reading and writing AVIF and HEIC in Lazarus
« Reply #2 on: February 09, 2025, 12:01:52 pm »
I also stumbled across the Lazarus AVIF and HEIC code.

Can't wait to play around with it and make some high definition animations.

Just amazing Tomxe from Poland.

fozkan

  • Newbie
  • Posts: 4
Re: Reading and writing AVIF and HEIC in Lazarus
« Reply #3 on: February 13, 2025, 11:48:38 am »
Thank you for this helpful wrapper. What are the details of DLLs (License, Origin...)?

Tomxe

  • New Member
  • *
  • Posts: 40
Re: Reading and writing AVIF and HEIC in Lazarus
« Reply #4 on: February 13, 2025, 08:59:14 pm »
Unit uses libheif.dll:

The libheif is distributed under the terms of the GNU Lesser General Public License.
Copyright (c) 2017-2020 Struktur AG
Copyright (c) 2017-2024 Dirk Farin
Contact: Dirk Farin dirk.farin@gmail.com

 

TinyPortal © 2005-2018