JPEG压缩
如何对JPEG文件进行压缩,不改变图像的长度及宽度,只调整其压缩率.
压缩后,生成的文件在 1024K 以内,但最接近 1024K. (1024K只是一个例子,可以更小,比如:100K等,目的是让用户自己设定)
目前100点,解决后另付300点.
问题点数:0、回复次数:8Top
1 楼CDSoftwareWj(95927)回复于 2004-05-04 19:37:09 得分 0
不可能吧,JPEG格式,本身就是压缩了的(JPEG无损压缩格式除外)不信你可以用RAR压压看少了多少??Top
2 楼SeaWave(NoSound)回复于 2004-05-04 20:06:29 得分 0
楼上大概未理解楼主的意思,楼主的意思是想重新调整JPEG的压缩率。
用TJpegImage吧,调整CompressionQuality属性的值,再调用Compress方法就可以改变其压缩率,当然,图像质量与压缩率是成反比的。Top
3 楼zousoft(菜菜鸟的战斗诗歌)回复于 2004-05-04 20:12:58 得分 0
同意楼上!
来晚了, 给你贴两断help吧. hehe
-----------------------------------------------------
Delphi syntax:
procedure Compress;
C++ syntax:
void __fastcall Compress(void);
Description
Call Compress to compress for optimization, such as before streaming out when assigning a bitmap to a jpeg. Changing properties like CompressionQuality does not force compression. To force compression, call Compress.
---------------------------------------------------------------------
Indicates the trade-off ratio between the image quality and the file size.
Delphi syntax:
property CompressionQuality: TJPEGQualityRange;
C++ syntax:
__property TJPEGQualityRange CompressionQuality = {read=FQuality, write=FQuality, nodefault};
Description
Use CompressionQuality to set the compression quality of the JPEG image when writing out a jpeg image. Higher compression results in a poorer picture quality, but a smaller file size. This property is not used for reading in files.
TJPEGQualityRange is the type of the CompressionQuality property. The higher the TJPEGQualityRange value (up to a maximum of 100), the better the image quality, but the larger the file size. The lower the TJPEGQualityRange value (to a minimum of 1), the smaller the resulting file size, but at the expense of picture quality.
Top
4 楼zousoft(菜菜鸟的战斗诗歌)回复于 2004-05-04 20:14:12 得分 0
补充: TJPEGQualityRange是1..100Top
5 楼miky(miky)回复于 2004-05-04 23:39:02 得分 0
用TJpegImage吧,调整CompressionQuality属性的值,再调用Compress方法就可以改变其压缩率,当然,图像质量与压缩率是成反比的。
那么CompressionQuality设为多少合适呢?Top
6 楼ly_liuyang(Liu Yang LYSoft http://lysoft.7u7.net)回复于 2004-05-05 00:20:47 得分 0
这就说不准了
但一般是50到70的Top
7 楼eliphe(未来)回复于 2004-05-11 13:35:06 得分 0
首先要user jpeg;
用TJpegImage吧,调整CompressionQuality属性的值,再调用Compress方法就可以改变其压缩率,当然,图像质量与压缩率是成反比的。Top
8 楼yjy1001(蓝鲸--优秀得郁闷的鱼)回复于 2004-06-09 14:03:26 得分 0
最一般的是75
但最低也要25 否则失真太多
请楼主自己看 <Visual C++ 实现MPEG/JPEG编解码技术> 一书里面有详细的源码 这里不帖了Top




