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
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
multitask question
by
MarkMLl
[
Today
at 09:49:03 pm]
Minimal IPC approach?
by
MarkMLl
[
Today
at 09:45:35 pm]
Errors linking the projec...
by
Grahame Grieve
[
Today
at 09:41:59 pm]
[solved] is there a non v...
by
Martin_fr
[
Today
at 09:13:11 pm]
Custom TRichMemo
by
What I can do
[
Today
at 09:10:10 pm]
IDE crashes and takes so ...
by
Martin_fr
[
Today
at 08:49:04 pm]
Newbie in Web Programming...
by
Nicole
[
Today
at 08:44:50 pm]
Compiling Lazarus from so...
by
TRon
[
Today
at 07:55:37 pm]
Macos Sequoia Lazarus 3.8...
by
ChrisR
[
Today
at 07:34:39 pm]
Planet generator(raylib)
by
Lulu
[
Today
at 07:29:54 pm]
Good online resource to l...
by
Thaddy
[
Today
at 06:41:21 pm]
TPaintbox picture disappe...
by
TRon
[
Today
at 06:31:33 pm]
login_tty and openpty are...
by
Fred vS
[
Today
at 06:19:14 pm]
ShowModal has a bug in Li...
by
TRon
[
Today
at 04:14:31 pm]
BGRABitmap can't compile
by
Khrys
[
Today
at 03:43:59 pm]
Why isn't Lazarus / Free ...
by
silvercoder70
[
Today
at 02:46:40 pm]
Lazarus Release Candidate...
by
dbannon
[
Today
at 02:02:57 pm]
Linux Laz Packages have i...
by
dbannon
[
Today
at 01:56:35 pm]
Is there a chart displayi...
by
simone
[
Today
at 10:19:27 am]
How to re use a process
by
Thaddy
[
Today
at 10:10:46 am]
Helping beginners
by
Thaddy
[
Today
at 09:15:26 am]
[SOLVED] Application stil...
by
d2010
[
Today
at 07:01:19 am]
TListView - please advis...
by
TRon
[April 29, 2025, 09:49:00 pm]
$CODEPAGE + LCL = Incorre...
by
Thaddy
[April 29, 2025, 06:47:53 pm]
SOLVED: Warning: "crtbegi...
by
Thaddy
[April 29, 2025, 06:43:37 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: Lepton reader and writer for Lazarus (Read 576 times)
Tomxe
New Member
Posts: 46
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: 616
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: 897
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
Newbie
Posts: 6
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: 46
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