Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Announcements
»
Third party
»
Lepton reader and writer for Lazarus
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
Many recent books on Laza...
by
Thaddy
[
Today
at 08:47:32 am]
Is this safe, changing fr...
by
marcov
[
Today
at 08:39:53 am]
Difference between @ and ...
by
DavidTh30
[
Today
at 07:58:00 am]
try/except error
by
Thaddy
[
Today
at 07:23:48 am]
How to connect to MariaDb...
by
Thaddy
[
Today
at 07:18:13 am]
docking IDE
by
kapibara
[
Today
at 04:20:33 am]
Isn’t this funny?
by
Joanna
[
Today
at 12:04:29 am]
Error when opening a proj...
by
Tomu
[July 15, 2026, 09:36:13 pm]
Slow app start on M5 MacB...
by
Thaddy
[July 15, 2026, 03:36:57 pm]
Solpage
by
munair
[July 15, 2026, 01:47:30 pm]
Need help with fphttpserv...
by
Thaddy
[July 15, 2026, 12:58:30 pm]
Freepascal
by
Thaddy
[July 15, 2026, 12:39:23 pm]
Lazarus interface to Rexx...
by
Thaddy
[July 15, 2026, 12:38:10 pm]
Parsing error?
by
Thaddy
[July 15, 2026, 12:02:02 pm]
is there PDS reader/expor...
by
cdbc
[July 15, 2026, 10:55:30 am]
Peculiarities in the EXE ...
by
marcov
[July 15, 2026, 09:57:51 am]
Conscious Artificial Inte...
by
schuler
[July 14, 2026, 11:40:27 pm]
Lazarus Bugfix Release 4....
by
Martin_fr
[July 14, 2026, 10:55:23 pm]
equivalent to C/C++ "offs...
by
Thaddy
[July 14, 2026, 07:37:23 pm]
LazSWatch - a serial port...
by
CM630
[July 14, 2026, 06:11:52 pm]
MarcoV, please contact. ...
by
jbthiel
[July 14, 2026, 05:35:26 pm]
lazbuild vs IDE: PPU chec...
by
Martin_fr
[July 14, 2026, 05:30:50 pm]
OpenDocument('Filename') ...
by
cdbc
[July 14, 2026, 12:45:35 pm]
TCollection wiki entry
by
Thaddy
[July 14, 2026, 10:56:03 am]
Install new .deb over exi...
by
Thaddy
[July 14, 2026, 07:16:45 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Lepton reader and writer for Lazarus (Read 954 times)
Tomxe
Full Member
Posts: 132
Lepton reader and writer for Lazarus
«
on:
March 04, 2025, 02:29:23 am »
Lepton is a JPEG repacker created by Dropbox but they cancelled the project.
Microsoft took the project and rewritten in Rust.
Lepton can recompress JPEG images to 20-30% smaller .LEP files and those .LEP files can be unpacked to get byte-by-byte identical JPEG images. So it works kinda like ZIP or RAR.
https://github.com/Xelitan/Lepton-reader-and-writer-for-Delphi-Lazarus
License: MIT
Usage examples- reading:
Code: Pascal
[Select]
[+]
[-]
Image1
.
Picture
.
LoadFromFile
(
'test.lep'
)
;
Writing:
Code: Pascal
[Select]
[+]
[-]
H
:
TLeptonImage
;
begin
Image1
.
Picture
.
LoadFromFile
(
'test.bmp'
)
;
H
:
=
TLeptonImage
.
Create
;
H
.
Assign
(
Image1
.
Picture
.
Bitmap
)
;
H
.
SetLossyCompression
(
44
)
;
H
.
SaveToFile
(
'test.lep'
)
;
H
.
Free
;
Packing and unpacking JPEGs:
Code: Pascal
[Select]
[+]
[-]
InF
:
=
TFileStream
.
Create
(
'input.jpg'
,
fmOpenRead
)
;
OutF
:
=
TFileStream
.
Create
(
'output.lep'
,
fmCreate
)
;
EncodeLepton
(
InF
,
OutF
)
;
and:
Code: Pascal
[Select]
[+]
[-]
InF
:
=
TFileStream
.
Create
(
'input.lep'
,
fmOpenRead
)
;
OutF
:
=
TFileStream
.
Create
(
'output.jpg'
,
fmCreate
)
;
DecodeLepton
(
InF
,
OutF
)
;
Logged
Okoba
Hero Member
Posts: 660
Re: Lepton reader and writer for Lazarus
«
Reply #1 on:
March 05, 2025, 10:25:50 am »
@Tomxe fantastic work!
Logged
Boleeman
Hero Member
Posts: 1160
Re: Lepton reader and writer for Lazarus
«
Reply #2 on:
March 05, 2025, 12:26:16 pm »
Fantastic Tomxe for this Lepton reader and writer.
Never heard of this format until now.
Some interesting information on how this format works is here:
https://dropbox.tech/infrastructure/lepton-image-compression-saving-22-losslessly-from-images-at-15mbs
The dropbox people said:
"We have used Lepton to encode 16 billion images saved to Dropbox, and are rapidly recoding our older images. Lepton has already saved Dropbox multiple petabytes of space."
Looks like it is a good lossless compression.
Thanks Tomxe for the Lepton reader and writer.
«
Last Edit: March 05, 2025, 12:29:01 pm by Boleeman
»
Logged
Now Prototyping in OpenProcessing and P5js
https://openprocessing.org/@Boleeman#sketches
https://editor.p5js.org/Boleeman/sketches
DrakkTheSeafarer
New Member
Posts: 13
Re: Lepton reader and writer for Lazarus
«
Reply #3 on:
March 05, 2025, 12:50:29 pm »
Thank you for sharing this. But is it a "Lossless" Compression procedure (JPEG is not) ?
Logged
Tomxe
Full Member
Posts: 132
Re: Lepton reader and writer for Lazarus
«
Reply #4 on:
March 05, 2025, 06:16:04 pm »
You can repack JPEG into Lepton losslessy, like ZIP. Then you can repack Lepton back into identical JPEG.
Logged
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Announcements
»
Third party
»
Lepton reader and writer for Lazarus
TinyPortal
© 2005-2018