jexd99
asked on
Fastest way to make jpg a bmp then back
I know how to convert these, I want to make sure I'm not doing the longggg way around :)
What is the fastest way to convert jpg to bmp, then back to jpg?
Thanks
What is the fastest way to convert jpg to bmp, then back to jpg?
Thanks
var
Bmp : TBitmap;
Jpg : TJpegImage;
begin
Bmp:= TBitmap.Create;
Jpg := TJpegImage.Create;
Bmp.LoadFromFile('filename .bmp');
Jpg.Assign(Bmp);
Jpg.SaveToFile('filename.j pg');
End;
Bmp.free;
Jpg.Free;
Bmp : TBitmap;
Jpg : TJpegImage;
begin
Bmp:= TBitmap.Create;
Jpg := TJpegImage.Create;
Bmp.LoadFromFile('filename
Jpg.Assign(Bmp);
Jpg.SaveToFile('filename.j
End;
Bmp.free;
Jpg.Free;
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
By the way, you do realize that switching back and forth between BMP anmd JPG formats is a really good way to have increasing numbers of anamolies introduced into you image, don't you? (JPG is what is termed a "lossy" format and should not be used for images that you will be modifying. ;-)
ASKER
Yup, I'm aware. Thanks :)
Bmp : TBitmap;
Jpg : TJpegImage;
begin
Bmp:= TBitmap.Create;
Jpg := TJpegImage.Create;
Jpg.LoadFromFile('filename
Bmp.Assign(Jpg);
Bmp.SaveToFile('filename.b
End;
Bmp.free;
Jpg.Free;