Sign in Join

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

Catalog · How the catalog works
Anything · Lazarus or Delphi
Random projectRandom project

Lepton-in-pure-Pascal-for-Free-Pascal-Delphi-Lazarus

Lepton in pure Pascal for Free Pascal/Delphi/Lazarus

View on GitHub

Member rating

No ratings yet.

Sign in to rate this project.

README

This is a pure Pascal version of Lepton written in RUST by Microsoft

which was based on Dropbox's Lepton written in C++

Based on version 0.5.3.

It can loslessly compress JPEGs into 50-80% of their size

CLI Usage - leptoncli.lpr

pascal
  leptoncli c  <in.jpg> <out.lep>  - compress JPEG -> LEPTON (+ round-trip verification)
  leptoncli cf <in.jpg> <out.lep>  - compress with no verification (faster)
  leptoncli d  <in.lep> <out.jpg>  - decompresss LEPTON -> JPEG

Usage in code:

pascal
uses LeptonSimple;

// Streams: compress/decompress the entire Infile into Outfile.
function LeptonCompressStreams(Infile, Outfile: TStream): Integer;
function LeptonDecompressStreams(Infile, Outfile: TStream): Integer;

// Files: opens Infilename, creates Outfilename.
function LeptonCompressFile(const Infilename, Outfilename: String): Integer;
function LeptonDecompressFile(const Infilename, Outfilename: String): Integer;

// In-memory buffers (AnsiString = raw bytes).
function Lepton(JpegBody: AnsiString): AnsiString;
function UnLepton(LeptonBody: AnsiString): AnsiString;