JPEG压缩

delphi1234567 2004-05-04 01:56:01
如何对JPEG文件进行压缩,不改变图像的长度及宽度,只调整其压缩率.
压缩后,生成的文件在 1024K 以内,但最接近 1024K. (1024K只是一个例子,可以更小,比如:100K等,目的是让用户自己设定)

目前100点,解决后另付300点.
...全文
278 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
yjy1001 2004-06-09
  • 打赏
  • 举报
回复
最一般的是75
但最低也要25 否则失真太多

请楼主自己看 <Visual C++ 实现MPEG/JPEG编解码技术> 一书里面有详细的源码 这里不帖了
eliphe 2004-05-11
  • 打赏
  • 举报
回复
首先要user jpeg;

用TJpegImage吧,调整CompressionQuality属性的值,再调用Compress方法就可以改变其压缩率,当然,图像质量与压缩率是成反比的。
ly_liuyang 2004-05-05
  • 打赏
  • 举报
回复
这就说不准了
但一般是50到70的
miky 2004-05-04
  • 打赏
  • 举报
回复
用TJpegImage吧,调整CompressionQuality属性的值,再调用Compress方法就可以改变其压缩率,当然,图像质量与压缩率是成反比的。

那么CompressionQuality设为多少合适呢?
zousoft 2004-05-04
  • 打赏
  • 举报
回复
补充: TJPEGQualityRange是1..100
zousoft 2004-05-04
  • 打赏
  • 举报
回复
同意楼上!
来晚了, 给你贴两断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.


SeaWave 2004-05-04
  • 打赏
  • 举报
回复
楼上大概未理解楼主的意思,楼主的意思是想重新调整JPEG的压缩率。

用TJpegImage吧,调整CompressionQuality属性的值,再调用Compress方法就可以改变其压缩率,当然,图像质量与压缩率是成反比的。
CDSoftwareWj 2004-05-04
  • 打赏
  • 举报
回复
不可能吧,JPEG格式,本身就是压缩了的(JPEG无损压缩格式除外)不信你可以用RAR压压看少了多少??

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi GAME,图形处理/多媒体
社区管理员
  • GAME,图形处理/多媒体社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧