VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 1234567[8]910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 06:49:05 04/05/01 Thu
Author: Michel
Subject: Re: File Size Increase
In reply to: James Fan 's message, "Re: File Size Increase" on 12:26:06 04/04/01 Wed


Hi James,

Yes I remember this issue. The trial DCU has an error on setting the tiff compression. The source code has been corrected. I have emailed you a new EnTifGr.DCU file.

Best regards,

Michel

>Hi Michel
>
>I just find out that if I use the pre-complied
>Demo.exe, everything work fine,I even get a
>much better compression after I save the tif image,
>from 38K to 4K.
>
>But if I compile and run the trail version, DemoD4
>project, it doesn't work,the saved tif image
>file doesn't not compress at all.
>
>
>Here is BeforeSave Event from the trial version.
>
>procedure TMainForm.ImageScrollBoxBeforeSave(const
>Sender: TImageScrollBox;
> const Graphic: TDibGraphic);
>begin
> { This event may be used to set parameters in the
>Graphic being saved.
> For example, the compression type in TIF files
>may be set. }
> if Graphic is TTiffGraphic then
> begin
> if Graphic.ImageFormat = ifTrueColor then
> TTiffGraphic(Graphic).Compression := tcJPEG
> else if Graphic.ImageFormat = ifBlackWhite then
> TTiffGraphic(Graphic).Compression :=
>tcGroup4
> else
> TTiffGraphic(Graphic).Compression :=
>tcPackbits;
> end;
>
> { this code can be used to save transparent png }
> if Graphic is TPngGraphic then
> begin
> (*
> { a background color may optionally be saved
>with the PNG file. }
> TPngGraphic(Graphic).SaveWithBackground :=
>True;
> TPngGraphic(Graphic).BackgroundColor :=
>MakeRgb(0, 255, 0);
>
> TPngGraphic(Graphic).SaveTransparent :=
>True;
> { for example, use upper left pixel as
>transparent }
> TPngGraphic(Graphic).TransparentColor :=
>TPngGraphic(Graphic).Rgb[0, 0];
> *)
> end;
>
>end;
>
>
>I use the debugger, trace into this event.
>Before the statement
>TTiffGraphic(Graphic).Compression := tcGroup4.
>The value of TTiffGraphic(Graphic).Compression is
>tcNone.
>After the statement TTiffGraphic(Graphic).Compression
>:= tcGroup4.
>The value of TTiffGraphic(Graphic).Compression is
>still tcNone.
>
>Is the trail version work differently from liciened
>version?
>
>Thanks in advance
>
>James
>
>>
>>Hi James,
>>
>>You need to set the compression type in the
>>ImageScrollBoxBeforeSave event. It should be something
>>like this:
>>
>>procedure TMainForm.ImageScrollBoxBeforeSave(const
>>Sender: TImageScrollBox;
>> const Graphic: TDibGraphic);
>>begin
>> { This event may be used to set parameters in the
>>Graphic being saved.
>> For example, the compression type in TIF files
>>may be set. }
>> if Graphic is TTiffGraphic then
>> begin
>> if Graphic.ImageFormat = ifTrueColor then
>> TTiffGraphic(Graphic).Compression :=
>tcJPEG
>> else if Graphic.ImageFormat = ifBlackWhite
>then
>> TTiffGraphic(Graphic).Compression :=
>>tcGroup4
>> else
>> TTiffGraphic(Graphic).Compression :=
>>tcPackbits;
>> end;
>>end;
>>
>>I believe some previous did not set the compression to
>>tcGroup4 for black and white images. You may get even
>>better compression by increasing the RowsPerStrip
>>property of TTiffGraphic.
>>
>>Best regards,
>>
>>Michel
>>
>>>Hi Michel
>>>
>>>Thank you for your reply.
>>>
>>>Right after I loaded the tif file (32k), the Format
>>>Conversion dialog confirm it is Black and White and
>>>the resolution is 1632 X 2156.
>>>
>>>Without any modification or image transform I saved
>>>the image, the file size is 10 time larger (430k)
>than
>>>the original.
>>>
>>>Then I loaded the 430k tif file again, the Format
>>>Conversion dialog confirm it is Blank and White and
>>>the resolution is 1632 x 2156.
>>>
>>>I planning to purchase your image library to create
>>>multi-page tif file for email, but the file size
>issue
>>>need to be resolved.
>>>
>>>Here is some more information about the tif file I
>>>created.
>>>
>>>I use a component from TurboPower Software to
>generate
>>>the original tif image file then I examined the
>>>property of this tif image file with the Imaging
>>>program come with Windows 98, it is Black and White
>>>with PackBits compression.
>>>
>>>I use the same Imaging program to examined the
>>>property of the tif file saved by the Demo program,
>it
>>>is Black and White but there is no compression.
>>>
>>>I hope the information is helpful.Thanks in advance.
>>>
>>>James
>>>
>>>
>>>>
>>>>Hi James,
>>>>
>>>>Is it possible that you have peformed any image
>>>>transform before saving? Some transforms need to
>>>>convert to True Color.
>>>>
>>>>Also check the image information by opening the
>>format
>>>>conversion dialog box (the grayed format will be the
>>>>current format) before and after the save.
>>>>
>>>>Best regards,
>>>>
>>>>Michel
>>>>
>>>>>I loaded a tif image file,size about 43K in to the
>>>>>TImageScrollBox. Without any modification, I save
>>the
>>>>>image
>>>>>again. The files size is 10 times larger then the
>>>>>original
>>>>>files,its 450K. Any idea what going on here??.
>>>>>
>>>>>I using the downloaded Demo program.
>>>>>
>>>>>Thanks

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:


[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.