| Delphi Graphics: Algorithms |
| A. General Graphics | B. Color | C. Image Processing | D. Mathematics/Geometry |
Also see Image Processing Reference Library
| General | Image Analysis Tools http://plsoft.users.btopenworld.com/html/image_analysis.html |
||||
![]() Envision Image Library provides image file I/O for popular file formats (TIFF, PNG, JPEG, BMP, PCX, TGA, ICO, WFM, EMF), printing, scanning and image processing features. Twain scanning. Image processing: anti-aliasing, brightness, contrast, convert to gray, edge detection, emboss, sharpen, flip vertical and horizontal, gamma adjustment, negative, interpolated resize, rotate 90, 180, 270 and arbitrary angle, cropping, format conversion including Floyd Steinberg dithering and color quantization. For Delphi 3, 4 or 5, or Builder 4. www.intervalsoftware.com |
|||||
| EStampe
by Jean-Yves Quéinec. Laboratory for Delphi graphics
techniques and algorithms. Excellent examples. Be sure to
compile with "range checking" off.
Estampe is specially designed to reduce image processing delays. It's two times faster to use than paintshop-pro for internet images because all the tools are visible. Blur and sharpen uses alternatively diagonal and orthogonal pixels to give better results. Image mix : Edge blur uses a roundrect or ellipse mask drawn with a two-pixel pen. Also see Jean-Yves Quéinec's Estampe Demo program |
|||||
Focus. Photoretouch
software
by
Francesco
Savastano.
|
|||||
| G32 Software Graphic Libraries and Tools
(by Alex Denisov) www.g32.org |
|||||
| IED: Image processing component suite. Load/save file formats, process images, vetorial objects, measurements, handle TWain, video capture, thumbnails, animated GIF/AVI/TIFF create/edit/modify, etc. http://delphi.icm.edu.pl/ftp/d30share/ied11d3.zip | |||||
| Imag: Component suite for image
processing and analysis. BMP, PCX, JPEG, animated GIF (LZW and NON-LZW no-Unisys
licence!) and TIFF; Twain scanners http://delphi.icm.edu.pl/ftp/d30free/imag070b.zip http://delphi.icm.edu.pl/ftp/d30free/imag065b.zip |
|||||
| ImagePro. Image Manipulation
Program. www.gu.edu.au/school/eng/mmt/ImProc.html |
|||||
Imaging Toolkit for Delphi
is a set of VCL components for image processing, scanning and storage.
|
|||||
| ImgSource. ImgSource is a Win32 DLL that can be used in any 32-bit environment capable of calling a Win32 DLL (VC++, VB, Access, SDK, etc). It provides over 160 image file and image processing functions. Most image processing functions are geared towards processing images as 24-bit RGB. Functions are provided for converting HBITMAP, DIB, 8-bit and grayscale to and from RGB 24-bit space. www.smalleranimals.com/isource.htm | |||||
| ImageEn Component Suite for image
processing and analysis. TIFF (RGB,CMYK,G3/G4 Fax,LZW), PNG, BMP, PCX, JPEG
(RGB,CMYK,YCbCr, YCbCrK), animated GIF (LZW and Non-LZW - no-Unisys licence),
ICO, CUR, WMF, EMF file formats; FULL TWain scanners control
(without display scanner user interface), video capture (real time image processing,
YUV cameras supported), thumbnails grid, create GIF/AVI animations, vectorial
objects (lines, box, ellipses, text...) over bitmaps and more. Pure VCL code, no DLL
required. Effects preview dialogs in six languages, advanced open/save dialogs. Store
hidden text/binary inside images. www.hicomponents.com (d4.0) http://delphi.icm.edu.pl/ftp/d40share/ie197d4.zip (d5.0) http://delphi.icm.edu.pl/ftp/d50share/ie197d5.zip (d6.0) http://delphi.icm.edu.pl/ftp/d60share/ie197d6.zip |
|||||
|
|||||
| Intel Image Processing Library http://developer.intel.com/software/products/perflib/ipl/index.htm Borland Delphi Example Application (near bottom of page). Source code for an image
editing application, written in Delphi, is provided. This application is
similar to the Image Editing Demo. Translation of header files for use in Delphi: |
|||||
| National Instruments provides a set
of ActiveX components for image acquisition and manipulation. When you install these
components and import into Delphi, the ActiveX import will list something like
"National Instruments CW IMAQ x.x (Version x.x)." Component Palette
Entries include: - TCWIMAQ: used for image acquisition from hardware |
|||||
The
complete Pascal source code for NIH Image V1.62. This source code is in the public domain.
|
|||||
| SkyLine Tools Imaging Royalty Free Native VCLs for Delphi SkyLine Tools Imaging, Award Winning Corporate Suite is the most comprehensive Royalty Free toolkit in the Delphi and C++ Builder arenas. SkyLine's toolkits enable the integratration of document imaging, internet transfer, color, grayscale,video, audio, medical imaging and barcode recognition into Delphi applications. http://delphi.icm.edu.pl/ftp/d30share/imglibd3.zip | |||||
| TImageProcessor can
manipulate images, including Arithmetic operations, Logical operations, Alphablending
operations, Morphological operations, Geometric
transforms amd Filters. www.fortunecity.com/skyscraper/download/125/imgprs.html |
|||||
| TGraphicsManager component. Change
colors, rotate, special effects http://www.pisarev.net/0/graphics/graphicsmanager/0/english/graphicsmanager.htm |
|||||
| 1-bit color | See pf1bit section of Scanline Tech Note |
||||
| Alpha Blending | TAgBlend - "Alpha blending" in
Windows (A "faded" effect in your forms) www.agnisoft.com/freeware.asp#AgBlend The function AlphaBlend performs an image composite operation
by overlaying the foreground image with the background image to produce the resultant
image. TImageProcessor. Logical Operations, Alpha blending, morphological operations, filters. www.fortunecity.com/skyscraper/download/125/imgprs20.zip |
||||
| Antialiasing | Rough Around the Edges -- Antialiasing in Delphi by
Rod Stephens, Delphi Informant, April 1998, pp. 60-64. www.informant.com/delphi, File Downloads, Delphi 3, DI9804RS.ZIP or www.informant.com/libs/delphi/3x/di9804rs.zip SmoothLn. Antialiasing picture/image component. Chris Hill's UseNet Post about Antialiased Fonts Harman's UseNet Post showing Delphi code to rotate an image any angle, with edge wrapping, and anti-aliasing. Resamples a 24-bit bitmap to half its original size by averaging the RGB values of 4 pixels into one pixel (anti-aliasing). http://norfolkgraphics.com/download/antialias.zip |
||||
| Analysis and Processing | - Regulation of contrast, HSL, HSV/ HSB and RGB components. - Six filters for quality resampling (rfTriangle, rfHermite, rfBell, rfBSpline, rfLanczos3, rfMitchell). - Application of 3x3 filters. - Merge two images. - Crop selected region. - Preview of all the effects in a single dialog, with 8 preset filters (blur, edge detection, emboss, highpass1/ 2/ 3, lowpass1/ 2) and save and load filters from file. - Conversion to gray scale and negative. - Conversions of true color to black/white images with ordered or threshold dithering. - Casting of a group of colors to a single color. - Rotate any angle (optional antialiasing). - Horizontal and vertical flip. - Bump mapping effect - Lens effect - Copy, cut, paste and paste into a rectangle of all or part of the image. - Undo last operation: automatic or manual. - Application effects to the selected zones (also irregular) - OnProgress event for monitoring image processing tasks. - Histogram equalization (auto and manual) and threshold. - Neural network color quantizer, for fast and accurate color reduction. - Reduction to any number of colors (with colormap output). - HSV channels separations. - A property to select dialogs language (english, italian, german, spanish, french). - A dialog to view a palette and select on it a color. - VCL component for HSV/ HSB color selection. - VCL component for displaying histogram of gray levels (or RGB channels). - Connections with standard TImage component |
||||
| Array | Array of TImages: efg's UseNet Post | ||||
| Aspect Ratio | Notes on maintaining aspect ratio of JPEG displayed in TImage. | ||||
| Bitmap Resizing | See Resampling | ||||
| Bitmap Rotation | efg's Lab Reports:
Jim Hargis' improved RotateBitmap that TRotateImage is a visual component derived from TGraphicControl. This
component similar to TImage can display graphical images on a form. In
addition, TRotateImage can rotate image across the center of the image in
any arbitrary angle. For flood-filled arrow heads, or rotation of arrows or axes: RotateAxes.ZIP T.G.'s UseNet Post with RotateBitmap code to rotate a DIB Detlef Brettschneider's E-mail with rotate_flip procedure Thomas Kowalski's routines that operate very quickly: SpiegellnHorizontal (Horizontal Mirror), SpiefelLnVertikal (Vertical Mirror), Drehen90Grad (90-degree rotation), Drehen180Grad (180-degree rotation) and Drehen270Grad (270-degree rotation) in his Unit7. Look at his Drehen90Grad routine for a way to use Streams and the GetDIBits API call that would be an alternative to accessing pixel data in D1 and D2 without the use of Scanline introduced in D3. Die Umsetzung für Delphi 2 funktioniert auch unter Delphi 3 und 4. Sie ist ein wenig schneller als deine Funktion. Ich benutze SaveToStream um an die DIB (Scanlines) zu kommen und bearbeite diese. http://home.t-online.de/home/PeterJHaas/bitmap.htm#Wie_dreht_man_eine_Bitmap Jack Sudarev's RotateBitmap procedure that performs antialiasing. Harman's UseNet Post showing Delphi code to rotate an image any angle, with edge wrapping, and anti-aliasing. Dave Shapiro's unit for rotating TBitmaps 90, 180, or 270 degrees. Works in D1, D2, D3,
and D4. Not entirely optimized, but quick enough. It rotates a 1600x1200 image in 800 msec
on his P2 400. Picture Perfect -- Shrinking, Enlarging, and Rotating Images by Rod Stephens in Delphi Informant, Nov. 1998, Vol. 4, No. 11, pp. 16-25. [Note: This article uses the very slow Pixels property. See efg's Lab Reports (links are below) for much quicker Scanline alternatives.] Simple demonstration program with bitmap scaling & rotation. (Delphi 3) PlgBlt (parallelogram block transfer) can be used to rotate a bitmap but only in
NT/2000.
See an example in Delphi Informant, Jan. 99, pp. 68-71. Download
code di9901rv.zip at www.informant.com/delphi/dfiles.asp Freddy Darsonville's E-Mail about a code starting point for rotation of a metafile See [Jähne, pp. 283-285] for discussion of 2- and 3-pass rotation algorithm. |
||||
| Blend Modes | How do Adobe Photoshop, Micrografx
PicturePublisher and Pegtop XFader blend layers? www.pegtop.net/delphi/blendmodes |
||||
| Blur | Gaussian
Blur Jean-Yves Quéinec's Estampe Demo program Change Brightness, Flip, Invert, Mirror, Gaussian Blur |
||||
| Brightness | D6/D7 GraphUtil: function ColorAdjustLuma(clrRGB: TColor; n: Integer; fScale: BOOL): TColor; efg's example of how to Change Brightness of pf24bit Bitmap (D3-D5) Jean-Yves Quéinec's Estampe Demo program Luminosity (Luminosità) in Regulating Digital Images (in Italian) Change Brightness, Flip, Invert, Mirror, Gaussian Blur Delphi Magazine Issue 45 Free Disk. After unzipping, look in the System directory, TestBed project. |
||||
| Comparison |
Example of comparing two TBitmaps
and counting number of pixels that match and differ.
Example of comparing two TIcons. efg's BMPJPG Lab Report compares BMPs from JPEGs of various qualities by computing correlation factor . Also, see the BitmapCompare command line program included with this Lab Report. See Comparing Files on efg's Delphi I/O: Files page. |
||||
| Contrast Enhancement | Jean-Yves Quéinec's Estampe Demo program Michael Christopher's C++ Builder component for simple image processing with 8 bit-images (invert and contrast enhancement). MichaelChristopher_IP_Image.zip Contrast (Contrasto) in Regulating Digital Images (in Italian) Also see: Text, Contrast |
||||
| Cropping | efg's Cropping Example
by CopyRect or Scanline
Kerstin Thaler's UseNet Post about how to
crop a bitmap using mouse events |
||||
| Dithering |
TGIFImage by Anders Melander Floyd-Steinberg dithering |
||||
| Dragging | Dragging an Image http://home.t-online.de/home/Robert.Rossmair/dragimg.zip Also see scrolling below Drag & Drop |
||||
| Encryption / Decryption | See Andreas Filsinger's original summary of this encryption method and an updated version for Delphi 6.01. |
||||
| Filters |
Note from Lazikas o Pontios about convolution filters. TImageProcessor. Logical Operations, Alpha blending, morphological operations, filters. www.fortunecity.com/skyscraper/download/125/imgprs20.zip HarmWave is a graphics application. It is mostly designed to create
tiles for use as web page backgrounds or windows wallpaper. It has many effects and
filters, but currently only supports BMP and JPG file types. Can be used to
edit/enhance photos. It uses Delphi's TBitmap.Scanline property extensively. 3-by-3 Convolution Filters |
||||
| Filters, Median Filter | Spyros' UseNet Post with Huang's
Algorithm (Pascal code) of computing median
Optimal median smoothing, Applied Statistics,
44(2): 258-264, W. Haerdle, W. and M. Steiger, 1995. |
||||
| Flip | Johnnie's UseNet Post with Flip procedure (uses stretchblt) See "Flip" part of ShrinkFlipReverse.TXT example Change Brightness, Flip, Invert, Mirror, Gaussian Blur |
||||
| Fourier Analysis, FFTs | See Digital Signal Processing, Fourier Transforms, FFTs section of efg's Engineering Mathematics Page | ||||
| Histograms | Produce the histogram and percentage of dark to
light pixels, of an eight bit gray scale Microsoft Windows bitmap (by
Charles Hacker). www.gu.edu.au/school/eng/mmt/ImProc.html
Display/Print Histograms (R, G, B, H, S, V)
The fourth order central moment (kurtosis) is a measure of peakedness of a histogram. |
||||
| Image Enhancemennt | Collage is a quick and easy to use image/movie viewer which includes a number of useful image processing and editing features. It is an MDI (Multiple Document Interface) application which means you can process several images in one workspace. Enhance images using the Autobalance, Sharpen, Smooth functions as well as a choice of 9 Zooming algorithms. Other features include cropping, resize, rotate, slideshow, fit-to-screen, text and border insertion.One of its strongest features is a powerful collage creation capability.this allows a number of images (or portions of images) to be pasted on to a single canvas and saved as a single image. Collage also has the ability to playback movies and to extract images from movies. http://delphi.icm.edu.pl/ftp/d30share/collg201.zip | ||||
| Image from Data | See how to create a shades-of-gray image from
a matrix of 8-bit data values. (This example creates a pf24bit bitmap from 8-bit data. To create a pf8bit bitmap with a palette, look at the pf8bit section of the Scanline Tech Note.) |
||||
| Image Marquee | See "Marquee, Image" | ||||
| "Magic Wand" | Magic wand tool found in many photoretouch
software packages http://digilander.iol.it/gensavas/francosava/Delphi/Delphi%20procedures/magwand.zip |
||||
| Noise Image | |||||
| OCR | Optical Character Recognition
Program OCR is used for recognition of Cyrillic letters using
backpropagation neural networks. |
||||
| Optimization | "Displaying your bitmaps quickly", Delphi Developer's Journal, July 1998, pp. 12-15. (Double buffering using Pixels instead of Scanline. This technique is not very quick compared to using Scanline!) File 98JUL/DDJ9873.ZIP at ftp.zdjournals.com/ddj. efg's Scanline Tech Note For some general optimization tips, see Optimization on efg's Delphi Miscellany page |
||||
| Pan | Descendant of TPanel that can display an image, pan, zoom, and paint on
it. You can define a coordinate system at any time, and it will remain true through all
the panning and zooming you want. www.csd.net/~daves/delphi/PanZoom.zip |
||||
| Pixel Profile | |||||
| Printing an Image | See Item 1, "How can I print a bitmap?" on efg's Delphi Printing
page Sending an image to the printer (FAQ 1211D) efg's Printer Demo #1 |
||||
| Rectangle-to-Trapezoid mapping | ![]() RectangleToTrapezoid.ZIP |
||||
| Resampling | Also see StretchDraw and Zoom
See TCanvas.StretchDraw example on Delphi Graphics VCL/RTL page Example of image resampling using Scanline (D3-D5) See "Shrink" part of ShrinkFlipReverse.TXT example Note from Lazikas o Pontios abut Resampling to zoom. Interpolating Bitmap Resampler by Anders Melander, Delphi 2/3 Simple demonstration program with bitmap scaling & rotation. (Delphi 3) Make a thumb nail Picture Perfect -- Shrinking, Enlarging, and Rotating Images by Rod Stephens in Delphi Informant, Nov. 1998, Vol. 4, No. 11, pp. 16-25. [Note: This article uses the very slow Pixels property. See efg's Scanline Tech Note for a much quicker Scanline alternative.] |
||||
| Reverse | See "Reverse" part of ShrinkFlipReverse.TXT example Change Brightness, Flip, Invert, Mirror, Gaussian Blur |
||||
| Rotation | See "Bitmap, Rotation" above | ||||
| Satellite Tools | www.davidtaylor.freeserve.co.uk/software/wxsat.htm | ||||
| Scanline | efg's Tech Note: Manipulating Pixels with Delphi's Scanline Property | ||||
| Scanners | Delphi Program for Radio Shack Cuecat Scanner www.undu.com/Articles/000928b.html See also TWAIN |
||||
| Satellite Images | GRIP (Geographic Raster Image Processor) processes PNG format images. Import Landsat, Slar, SAR, and AVHRR imagery into the PNG format. www.winsite.com/info/des_package_1500000034993.html | ||||
| Scrolling | ScrollBars with TImage See \Program Files\Borland\Delphi n\HELP\Examples\Scrollba\ScrolDem.PAS
Example of how to scroll 1024-by-768 BMP in a 128-by-128 TImage using scroll bars, or by dragging with the mouse. "Scrolling an Image," pp. 24-25, Chapter 22 (online "bonus" chapter) of Mastering Delphi 5 by Marco Cantù. TScrollingImage Component is a visual component for use with Borland's Delphi. It display a scrollable (in 4 directions) image. www.programmersheaven.com/zone2/cat502/5836.htm Wayne Herbert's Sample Project (D3 or higher) showing how to scroll a TImage including "The Basics of Scoll Bar Implementation" (in file kmscrollbaru.pas) |
||||
| Sharpen | Jean-Yves Quéinec's Estampe Demo program | ||||
| Spiral Transform | See example on Delphi Graphics Algorithms: Math/Geometry page | ||||
| Texture Mapping | Delphi Graphics Programming by
Peter Dove and Don Peer in Delphi Informant: Part III, Mar 97: "Texture Mapping" (pp. 74-82). Textures Anders Isaksson UseNet Post with Example Bump mapping |
||||
| Thumb nails | See "Resampling"
How to create thumbnails of JPEG images programmatically Super Thumbnails |
||||
| TWAIN | (Technology Without An Interesting Name)
EZTwain Pro 3 - 32-bit DLL with Delphi interface, offers comprehensive Handle the acquisition from scanners (devices) that are TWAIN
compliant. Selecting the desired scanner and acquiring an image is
as easy as thinking of it. Tested with HP, Epson, Logitech, Mustek,
Fujitsu and several other scanners over a wide range of computers. TImagePlus/TDbImagePlusTImageTwain/TDbImageTwain. These
components make use of Twain Scanners & Cameras simple built-in
popup menu with Cut / Copy / Paste / Open / Save As / Stretch / Center /
Aspect / Select Source / Acquire image and more.
The TWAIN Working Group is a not-for-profit organization which represents the imaging industry. TWAINs purpose is to provide and foster a universal public standard which links applications and image acquisition devices. The ongoing mission of this organization is to continue to enhance the standard to accommodate future technologies. www.twain.org |
||||
| Tween | |||||
| Video | See Video on efg's Delphi Multimedia page Delphi example of DirectX Video with EPIX PIXCI Card |
||||
| Viewer | Borland example: ..\Delphi n\Demos\ImagView\Imagview.dpr "Bitmap Viewer -- MDI Child Form," Delphi 5 Developer's Guide by Teixeira and Pacheco in Online "CD" Chapters, pp. 262-271 Viewer: Simple image viewer with high quality display of
images even on 256-, 32K and 64K-colour adapters. Displays TGA, JPEG, GIF, WMF and BMP
files. Slide Show: Program to make a slide show from a list of JPEG images.
|
||||
| Watermarks | RadomAccess' UseNet Post about watermarks | ||||
| Wavelets | Non-Delphi: See Wavelets Section of efg's Mathematics Page |
||||
| Web Applications | Tutorials from the Delphi Apostle: Showing Images in a Browser from a Database Reducing Image Size On-the-Fly (thumbnails) |
||||
| Windows Shutdown Effect | Steve Schafer's UseNet Post about how to apply the Windows Shutdown Screen Effect to a Bitmap using CopyMode | ||||
| Zoom | Also see Resampling
Serge Gubenko's ZoomOutSources that captures and enlarges an area of the Windows desktop. Works similar to ZoomIn utility from Visual Studio, but has more functionality, such as drawing grid lines. Zoomer TZoomDisplay Zoom Descendant of TPanel that can display an image, pan, zoom, and paint on it. You can
define a coordinate system at any time, and it will remain true through all the panning
and zooming you want. TMagnify VCL component for displaying images. Easy-to-use scrolling and zooming.
Dr. Chris Rorden's Kylix magnifier example |
Links Verified 6 Feb 2000
Updated 26 Feb 2005
since 6 Feb 2000