AspJpeg用户手册 第四章02

| 分类: 外文翻译 订阅所有外文翻译的日志

4.4 图像翻转和旋转Image Flipping and Rotation

用AspJpeg 1.2以上版本,你可以通过调用FilpH方法以及FlipV方法任意地水平/垂直翻转一张图片With AspJpeg 1.2+, you can invert an image horizontally and/or vertically by calling the methods FlipH and FlipV, respectively.

你也可以用RotateR方法以及RotateL方法任意地把一张图片顺时针旋转90度或者逆时针旋转90度.You can also rotate an image 90 degrees clockwise and counter-clockwise by calling the methods RotateR and RotateL, respectively.

4.5 调整图像压缩比Adjusting Image Compression

Jpeg图像格式采用了有损压缩方法,这意味着一张图片在保存为Jpeg过程中一些次要细节丢失了。损失程序可以用Jpeg.Quality属性来调节。这个属性认可一个从0到100范围的整型数值,0是损失率最高(因此,质量最低),100是损失率最低,质量最高。The JPEG format uses "lossy" compression methods. This means that some minor details of an image saved as a JPEG are lost during compression. The degree of loss can be adjusted via the Jpeg.Quality property. This property accepts an integer in the range 0 to 100, with 0 being the highest degree of loss (and hence, the lowest quality) and 100 being the lowest degree of loss and highest quality.

损失率越低,生成的文件体积越大。属性值Jpeg.Quality默认值被设置为80,它提供了一个接近最佳的图像质量和文件体积组合。The lower the loss, the larger the resultant file size. The property Jpeg.Quality is set to 80 by default which provides a close-to-optimal combination of quality and file size.

4.6 灰度转换Grayscale Conversion

从1.4版开始,AspJpeg通过Grayscale方法可以把一张彩****片转换成灰度,这个方法Starting with version 1.4, AspJpeg is capable of converting a color image to grayscale via the Grayscale method. This method expects a Method argument which specifies a formula to perform the color-to-B&W conversion. The valid values are 0, 1, and 2. The value of 1 is the recommended method for most applications.

The Grayscale method sets the three color components (R, G, B) of each pixel to the same value L using the following formulas

MethodFormula
0L = 0.3333 R + 0.3333 G + 0.3333 B
1L = 0.2990 R + 0.5870 G + 0.1140 B
2L = 0.2125 R + 0.7154 G + 0.0721 B

The effect of the Method argument is demonstrated by the chart below:

MethodEffect
Original Image
0
1
2

方法0的效果在photoshop中称为“去色”(图像->调整->去色)The effect of Method 0 is what Photoshop calls desaturation (Image/Adjust/Desaturate), while Method 1 is similar to Photoshop's conversion from RGB to grayscale (Image/Mode/Grayscale).

注意Grayscale是一个方法,不是一个属性,所以“=”号是不能够用的。必须写成以下样式:Note that Grayscale is a method, not a property, so the '=' sign should not be used:

Jpeg.Grayscale 1




[本日志由 稽山草 于 2008-10-28 11:59 PM 编辑]
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: persits.jpeg使用手册
评论: 0 | 引用: 0 | 查看次数: 1131
发表评论
本站不欢迎游客针对博客文章发表评论,留言请点此