Hi,
What's the best way to convert TIFF files from a fax machine into separate JPG files?
If I leave the default settings, when I receive a 70K three page TIFF
COMPRESS True
TIFF_COMPRESS GROUP4
And save this as JPG's I get three 800K pages.
If I set LOSSY_QUALITY to one I get three 98K pages (and the quality is quite bad).
Is there any way I can get three JPG's that total 70K?
(am I missing some JPG attributes - I'm only setting the LOSSY_QUALITY at present).
Code snippet
procedure TForm1.Button1Click(Sender: TObject);
var
aImageMan : TImageControl;
imageCount : integer;
newFilename : string;
attrs : OleVariant;
iLossy : integer;
begin
if OpenDialog1.Execute then begin
attrs := CreateOLEObject('IMActX8.Attributes');
aImageMan := TImageControl.Create(nil);
try
aImageMan.Picture := OpenDialog1.FileName;
attrs.Add( 'EXTENSION', 'JPG', IMString);
TryStrToInt( edtLossy.Text, iLossy);
attrs.Add( 'LOSSY_QUALITY', iLossy, IMInt32);
for imageCount := 0 to aImageMan.Pages -1 do
begin
aImageMan.PageNumber := imageCount;
newFilename := CreateTempFile('.jpg');
aImageMan.SaveAs(newFilename, attrs);
end;
finally
aImageMan.free;
end;
end;
end;
Thanks,
Ben