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
paszlib. Feature request ...
by
Tomxe
[
Today
at 06:20:43 am]
Portable verion of FPC an...
by
Thaddy
[
Today
at 06:07:32 am]
Death of the Power User
by
440bx
[
Today
at 05:47:41 am]
Linking a PortAudio stati...
by
bbrx
[May 20, 2026, 08:02:20 pm]
text color visible
by
wp
[May 20, 2026, 07:02:24 pm]
Run code during DLL load
by
cdbc
[May 20, 2026, 05:44:21 pm]
How to wait until a WebDA...
by
Hartmut
[May 20, 2026, 04:36:03 pm]
Anubis activated
by
rvk
[May 20, 2026, 02:09:42 pm]
IDE Windows Centered
by
zeljko
[May 20, 2026, 01:51:37 pm]
QuotedStr
by
wp
[May 20, 2026, 12:52:30 pm]
LazNodeEditor (visual nod...
by
gidesa
[May 20, 2026, 12:36:09 pm]
TMemoryStream, manual mem...
by
marcov
[May 20, 2026, 12:16:31 pm]
LZMA, LZMA2 and XZ
by
LemonParty
[May 20, 2026, 11:24:36 am]
Anubis's website security...
by
ALLIGATOR
[May 20, 2026, 11:21:32 am]
Problem with upgrading to...
by
paweld
[May 20, 2026, 08:25:45 am]
[SOLVED] wildcard utiliti...
by
mas steindorff
[May 20, 2026, 08:21:18 am]
Can /my/ AI help me with ...
by
microxa
[May 20, 2026, 06:25:26 am]
[CLOSED] Temp file CGI000...
by
Thaddy
[May 20, 2026, 06:04:41 am]
Cannot get FTP to work
by
Remy Lebeau
[May 20, 2026, 01:39:32 am]
[SOLVED] Limiting Search ...
by
jamie
[May 20, 2026, 01:32:11 am]
ERROR: The current FPC ha...
by
BubikolRamios
[May 19, 2026, 11:49:03 pm]
Lazarus IDE on Kubuntu lo...
by
backprop
[May 19, 2026, 08:51:53 pm]
Flamerobin error-message
by
maurog
[May 19, 2026, 08:07:45 pm]
Esri shapefile writer
by
Hansvb
[May 19, 2026, 08:06:03 pm]
Feature suggestion - repe...
by
Warfley
[May 19, 2026, 07:38:40 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Lepton reader and writer for Lazarus (Read 951 times)
Tomxe
Jr. Member
Posts: 84
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: 1158
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: 11
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
Jr. Member
Posts: 84
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