Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
Graphics
(Moderator:
Ask
) »
bgrabitmap reduce quality
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Bugtracker
IRC channel
Latest SVN
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
Creating descendants of T...
by
egsuh
[
Today
at 04:01:45 am]
x64 32bit floating point ...
by
kagamma
[
Today
at 03:56:43 am]
[SOLVED] Formating an int...
by
torbente
[
Today
at 03:43:25 am]
String consts from HTML o...
by
ydd
[
Today
at 03:18:09 am]
Fpcupdeluxe
by
trev
[
Today
at 03:03:00 am]
TSpeedButton in front of ...
by
torbente
[
Today
at 02:53:15 am]
Brook - Beginner trying t...
by
RedOctober
[
Today
at 01:58:59 am]
Turtle Graphics
by
Fred vS
[
Today
at 01:38:15 am]
Copy File to MTP
by
dbannon
[
Today
at 01:24:07 am]
Application Not starting ...
by
dseligo
[
Today
at 12:54:07 am]
« previous
next »
Print
Pages: [
1
]
Author
Topic: bgrabitmap reduce quality (Read 737 times)
xinyiman
Hero Member
Posts: 2145
bgrabitmap reduce quality
«
on:
December 28, 2019, 06:59:50 pm »
Hi guys, I have a question. How can I reduce the quality of an image? I am looking for something similar to
TJPEGImage.CompressionQuality
But for bgrabitmap
Logged
Win10, Ubuntu and Mac
Lazarus: 2.1.0
FPC: 3.3.1
winni
Hero Member
Posts: 2116
Re: bgrabitmap reduce quality
«
Reply #1 on:
December 28, 2019, 08:06:26 pm »
Hi!
JP(E)G is a lossy file format.
BGRA is a format to store, convert an show images.
You can save a BGRAbitmap with low quality/high compression as a JPG, but who wants that?
Winni
Logged
lainz
Hero Member
Posts: 3918
Leandro Diaz
Re: bgrabitmap reduce quality
«
Reply #2 on:
December 28, 2019, 10:42:13 pm »
In LazPaint is used this:
Code: Pascal
[Select]
[+]
[-]
FJpegStream
:
=
TMemoryStream
.
Create
;
writer
:
=
TFPWriterJPEG
.
Create
;
writer
.
CompressionQuality
:
=
JpegQuality
;
FFlattenedOriginal
.
SaveToStream
(
FJpegStream
,
writer
)
;
writer
.
Free
;
FFlattenedOriginal is a TBGRABitmap.
uses
fpwritejpeg;
Logged
circular
Hero Member
Posts: 3645
Re: bgrabitmap reduce quality
«
Reply #3 on:
December 29, 2019, 04:55:57 pm »
Indeed you need to pass the image writer as a parameter to specify the desired format options. Works as will with SaveToFile.
Logged
Conscience is the debugger of the mind
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
Graphics and Multimedia
»
Graphics
(Moderator:
Ask
) »
bgrabitmap reduce quality
TinyPortal
© 2005-2018