The answer to your question depends on the file types you choose and the quality needed. It is not a simple question to answer. The most effective way to reduce file size is to resample the image to smaller dimensions. Having said that, the next most effective parameters are the file type, the bit depth and the compression level, JPEG Quality or PNG_Compression. Png images and jpeg images are probably the best. Bit depths of 256 color may help reduce file size.
You will have to experiment with these parameters to see what the result is to produce the smallest files with the highest quality.
// Sets color-mapped 256 colors
ImageEnView1.IO.Params.BitsPerSample := 8;
ImageEnView1.IO.Params.SamplesPerPixel := 1;
// Sets JPEG quality of 70%
ImageEnView1.IO.Params.JPEG_Quality := 70;
ImageEnView1.IO.SaveToFile('D:\output.jpg');
If your images are jpeg, then reduce the Jpeg quality to a level that produces the results that are needed for your use and display of the images in your application. If 256 color images are not acceptable then use 24-bit.
ImageEnView1.IO.Params.BitsPerSample := 8;
ImageEnView1.IO.Params.SamplesPerPixel := 3;
The file size probably will be larger with 24-bit but only you can decide on the quality of the image you need.
If your files are PNG then experiment with PNG Compression. (iexBitmaps.pas)
ImageEnView1.IO.Params.PNG_Compression := 9;
See the help file in IO.Params for the various parameters that can be set depending on the file type.
An alternative to consider is using TImageEnMView to display thumbnails of jpg images, by using a StoreType property of ietFastThumb or ietThumb. The default is ietNormal which does not use thumbnails but require more time for loading. Then if you need to display the entire original image, load the file into TImageEnView using the filename stored in the ImageEnMView1.MIO.Params[x].Filename parameter. When the StoreType peoperty is set to ietFastThumb or ietThumb if you load the image into TImageEnView, the quality and the size of the image will be poor. That way you can have both fast loading of images (thumbnails) and still have access the full original image from the filename.
Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development