TrueColorToPalette v 1.1
High-quality Jpeg to GIF conversion in ASP.NET
With this product you can convert a True Color image to
palettized one using Floyd-Steinberg dithering algorithm. GDI+, by default,
uses a halftone palette, that creates ugly looking, poor quality images.
New algorithm gives images without grain looking just like original ones. This
is especially useful for photography. In order to use the new conversion
technique, you just need to copy one file. This is useful for hosting
servers because you don't need to register any components.
Download TrueColorToPalette.zip
VB.NET Sample that creates GIF image and ouputs it to stream can be found
here.
Compare two images
 |
 |
| The image with new algorithm |
The image with standard algorithm |
Source code:
Gif.aspx
<%@ Page Language="VB" %>
<%@ import Namespace="System.Runtime.InteropServices" %>
<%@ import Namespace="System.Drawing.Drawing2D" %>
<%@ import Namespace="System.Drawing" %>
<%@ import Namespace="System.Drawing.Imaging" %>
<%@ import Namespace="System.Globalization" %>
<script runat="server">
Sub Page_Load
dim img as Bitmap = new Bitmap(200,100,PixelFormat.Format24bppRgb)
dim g as Graphics = Graphics.FromImage(img)
dim p as Pen = new Pen(Color.Black,1)
dim b as Brush = new SolidBrush(Color.Green)
dim MS as System.IO.MemoryStream = new System.IO.MemoryStream()
g.Clear(Color.White)
g.FillRectangle(b,20,20,40,40)
g.DrawRectangle(p,25,25,50,50)
Dim dt As DateTime = DateTime.Now
Dim drawFont As New Font("Arial", 22)
Dim drawBrush As New SolidBrush(Color.Red)
Dim drawPoint As New PointF(75F, 50F)
g.DrawString(dt.ToString("T", DateTimeFormatInfo.InvariantInfo), _
drawFont, _
drawBrush, _
drawPoint)
'=====================================================================
Dim bitmappal As Bitmap
Dim Conv As ConvertToPalette = New ConvertToPalette()
bitmappal = Conv.ConvertToPal(img,1,256)
'=====================================================================
bitmappal.Save(MS,ImageFormat.Gif)
Dim buffer as byte() = MS.ToArray()
Response.Clear()
Response.ContentType = "Image/Gif"
Response.OutputStream.Write(buffer,0,buffer.Length)
Response.End()
End Sub
Public Class ConvertToPalette
... skip ...
End Class
</script>
Features:
-
Royalty-free for software and web site developers
-
The easy installation. No need to register the component, just copy the file to
bin directory
-
Converts from True Color to palettized images
-
Creates transparent GIF image
-
Based on ASP Painter technology
Quick start instruction:
-
Copy TrueColorToPalette.dll file into bin directory of ASP.NET project
-
Add class ConvertToPalette to project
-
Add namespace System.Drawing.Drawing2D,
System.Drawing, System.Drawing.Imaging, System.Runtime.InteropServices
-
Create new instance of ConvertToPalette class
-
Make new palette bitmap with ConvertToPal method
-
Save bitmap to a file or stream.
TrueColorToPalette purchase
TrueColorToPalette Trial -
Download now!
|
|
Distribution package includes |
|
- TrueColorToPalette.dll file
|
|
- ASP.NET and VB.NET samples |
License Summary: Can be used freely for non-commercial purpose.
Limitation: no more than 16 colors in resulting image.
TrueColorToPalette Basic
- Purchase Now!
|
|
Distribution package includes |
|
- TrueColorToPalette.dll file
|
|
- ASP.NET and VB.NET samples |
|
- one site/workstation license |
License Summary: TrueColorToPalette Basic can be used for any purpose
including the development of derivative products
TrueColorToPalette PRO -
Purchase Now!
|
|
Distribution package includes |
|
- TrueColorToPalette.dll file
|
|
- ASP.NET and VB.NET samples |
|
- five sites/workstations license |
License Summary: TrueColorToPalette Pro can be used for any purpose
including the development of derivative products
TrueColorToPalette Enterprise -
Purchase Now!
|
|
Distribution package includes |
|
- TrueColorToPalette.dll file
|
|
- ASP.NET and VB.NET samples |
|
- unlimited number of sites/workstations license |
License Summary: TrueColorToPalette Enterprise version can be used freely
for any purpose
To order by phone, call (877)-REGSOFT and tell the product ID
Technical support: support@asppainter.com