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
CudaText editor (written ...
by
szlbz
[
Today
at 02:16:25 pm]
PasLLM - LLM Inference En...
by
matthius
[
Today
at 01:41:45 pm]
Theoretical question. Laz...
by
Petrus Vorster
[
Today
at 01:09:19 pm]
Stacked bars not drawn pr...
by
apeoperaio
[
Today
at 12:57:01 pm]
New book on Object Pascal
by
matthius
[
Today
at 12:55:36 pm]
[SOLVED] Assembler error ...
by
dbannon
[
Today
at 12:55:16 pm]
The compiler fails to war...
by
Martin_fr
[
Today
at 12:44:31 pm]
four squares (inc)
by
speter
[
Today
at 11:25:05 am]
Regarding the issue of de...
by
Martin_fr
[
Today
at 10:20:35 am]
Dice (raylib + kraft phys...
by
fcu
[
Today
at 09:01:24 am]
Lazarus seems to be makin...
by
Boleeman
[
Today
at 07:54:25 am]
[SOLVED] Lazreport PDF
by
Petrus Vorster
[
Today
at 07:42:59 am]
Maze Makers: Modified Cyl...
by
Boleeman
[
Today
at 07:20:10 am]
How to set the Excel cell...
by
dodgex
[
Today
at 04:51:41 am]
Embedded qss stylesheets ...
by
jns
[January 14, 2026, 11:27:39 pm]
TSpeedButton qt6 styleshe...
by
big_M
[January 14, 2026, 04:53:29 pm]
How to prevent onDropFile...
by
Hansaplast
[January 14, 2026, 04:51:23 pm]
Linked List Using Two Cla...
by
Thaddy
[January 14, 2026, 03:39:08 pm]
unit init, finalize and i...
by
Zvoni
[January 14, 2026, 02:48:57 pm]
Locate current record aft...
by
Zvoni
[January 14, 2026, 09:59:08 am]
Drag and Drop Files; onDr...
by
Hansaplast
[January 14, 2026, 09:39:25 am]
Lazarus and Libre Office
by
MarkMLl
[January 14, 2026, 09:22:14 am]
scat bikes (inc)
by
speter
[January 14, 2026, 04:38:11 am]
Effect of adding properti...
by
n7800
[January 14, 2026, 04:13:36 am]
solution for installing F...
by
BradleySlavik
[January 14, 2026, 02:37:22 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Lepton reader and writer for Lazarus (Read 867 times)
Tomxe
New Member
Posts: 47
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: 621
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: 1076
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
DrakkTheSeafarer
New Member
Posts: 10
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
New Member
Posts: 47
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