Home    PhotoController Online Documentation Prev Next
PhotoController
Welcome
Features
Installation
Release Notes
What's New
Requirements
Reference
Classes
Controller
Methods
Properties
FeatherBuilder
Methods
Properties
PhotoControllerException
Structure
Borders
Filters
Enumeration
AdjustType
AnchorType
CompressionType
FilterStyle
FeatherBackgroundStyle
FlipFlags
PhotoBorderStyle
PhotoFormat
Artical
Another Use with Feather
Effect with ColorAdjust
Effect with Filters
Effect with Borders
Feather Samples
Gif Compression Algorithm
Resize the uploaded image
Saving Comparison
Saving Gif
Why Using InterpolationMode
Work with ASP.NET
Write Customized Borders
License
Purchase
[Top]
PhotoController Component for .NET ImageComponent.NET Logo
Saving GIF


This is going to demonstrate the saving Gif with compression in PhotoController. For Jpeg saving please read this.

Here is the source Gif photo.

File Size: 30.7KB

Use PhotoController to save this photo with 256 Standard color compression type.

[C#]

objPC.Save( "Standard256.GIF" , CompressionType.GifStandard256 , 0 , PhotoFormat.Gif , false);

This code shows saving to a file named Standard256.Gif and using GifStandard256 compression type and setting that it is not transparent.

Below is the result:

File Size: 19.3 KB

Remark: We can see the color is different in some place. That's because the new photo is saved with only 256 color and other colors are lost.

Use PhotoController to save the original photo with 216 WebSafe compression type.

[C#]

objPC.Save( "Websafe216.GIF" , CompressionType.GifWebSafe , 0 , PhotoFormat.Gif , false);

Below is the result:

File Size: 12.7 KB

Remark: The size is more smaller, because the new photo has only 216 color.

Use PhotoController to save the original photo with GifAdaptive compression type.

[C#]

objPC.Save( "Adaptive.GIF" , CompressionType.GifAdaptive , 0 , PhotoFormat.Gif , false);

Below is the result:

File Size:27.5KB

Remark: We can see the photo is more clear but the size is not that satisfied. This compression type will create a similar color table to the original one, so it will get a good effect if the original photo has lots of similar colors.

Use PhotoController to save the original photo with GifOctreeQuantizer compression type. GifOctreeQuantizer is a way which enables to specify the color quality, from 1 to 256.

[C#]

objPC.Save( "filename" , CompressionType.GifOctreeQuantizer , [Quality Value], PhotoFormat.Gif , false);

Below are three results:

When Quality is 256

File Size: 30.6KB

When Quality is 128

File Size:18.5KB

When Quality is 64

File Size:14.9KB

 

2005-2007 © ImageComponent.NET. All rights reserved.

Valid HTML 4.01 Transitional