GraphicEx - a Delphi image loader library
Clone or download
Latest commit 6b75a3f Dec 8, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
3rd party - some formatting fixed and garbage of old comments and code Mar 16, 2017
Demos Add units to allow demos to build Dec 6, 2018
TestSuite original Revert "EPS works well, working on another TIFF compression and color… Aug 25, 2016
TestSuite Revert "EPS works well, working on another TIFF compression and color… Aug 25, 2016
.gitignore dir to choose in edit Mar 8, 2014
AllGraphicStrings.pas Automatic language selection at runtime, using AutoResourceStr lib. Mar 15, 2017
Compilers.inc Now compiles without warnings on Delphi7, XE2, XE5, XE7, Delphi 10 Se… Sep 2, 2016
For older (non-unicode) versions of Delphi.txt Added text file explaining what to do when GraphicStringsXX files can… Mar 16, 2017
GraphicColor.pas Fully operational on x64 Sep 21, 2016
GraphicCompression.pas Fixed formatting Sep 21, 2016
GraphicConfiguration.inc Added old TIFF lib, fixed opening PSP .tub from test suite, added .ge… Aug 25, 2016
GraphicEx.chm Added demo projects and the chm help file. Mar 1, 2014
GraphicEx.pas - some formatting fixed and garbage of old comments and code Mar 16, 2017
GraphicStrings.pas Automatic language selection at runtime, using AutoResourceStr lib. Mar 15, 2017
GraphicStringsCT.pas Automatic language selection at runtime, using AutoResourceStr lib. Mar 15, 2017
GraphicStringsDE.pas Automatic language selection at runtime, using AutoResourceStr lib. Mar 15, 2017
GraphicStringsEN.pas - some formatting fixed and garbage of old comments and code Mar 16, 2017
GraphicStringsES.pas Automatic language selection at runtime, using AutoResourceStr lib. Mar 15, 2017
GraphicStringsEnUk.pas - some formatting fixed and garbage of old comments and code Mar 16, 2017
GraphicStringsFR.pas Automatic language selection at runtime, using AutoResourceStr lib. Mar 15, 2017
GraphicStringsIT.pas Automatic language selection at runtime, using AutoResourceStr lib. Mar 15, 2017
GraphicStringsPL.pas Automatic language selection at runtime, using AutoResourceStr lib. Mar 15, 2017
GraphicStringsRU.pas - some formatting fixed and garbage of old comments and code Mar 16, 2017
JpegCompression.pas - some formatting fixed and garbage of old comments and code Mar 16, 2017
LICENSE Initial commit Mar 1, 2014
MZLib.pas MZLib from old GraphicEx Mar 5, 2014
README.md README.md rewrote, now it's pretty optimistic, but hope the lib deser… Mar 16, 2017
TIFF.pas - TIFF JPEG works correctly with images which has width and height wh… Sep 20, 2016

README.md

GraphicEx

GraphicEx is an addendum to Delphi's Graphics.pas to enable your application to load many common image formats. This library is primarily designed to load images as background (buttons, forms, toolbars) and textures (DirectX, OpenGL) or for image browsing and editing purposes as long as you don't need to save images. Currently only TTargaGraphic also supports saving an image. GraphicEx is open source under the Mozilla Public License (MPL).

Homepage: http://www.soft-gems.net/index.php/libs/graphicex-library

The code here includes some bug fixes and enhancements I have never made available on my homepage. Since I cannot work on this lib any longer I open it up for forks and contributions by others if they interested. If there's significant feedback with fixes and new code I'm willing to publish new releases on my homepage as well.

Image Formats

TIFF images (*.tif; *.tiff), extended base line implementation
    1..16 bits per sample
    indexed, grayscale, RGB(A), CMYK, L*a*b*
    uncompressed, packed bits, LZW, CCITT T.4, CCIT T.4 2D, CCIT T.6, Thunderscan, Deflate, new style JPEG
GFI fax images (*.fax), uses TTIFFGraphic to read
SGI images (*.bw, *.rgb, *.rgba, *.sgi)
    1..16 bits per sample
    indexed, grayscale, RGB(A)
    uncompressed, RLE
Autodesk images files (*.cel; *.pic)old style only
    8 bits per sample, indexed and uncompressed
Truevision images (*.tga; *.vst; *.icb; *.vda; *.win), write support included
    5 and 8 bits per sample
    grayscale, indexed, 15 bits RGB (555), 24 bits RGB(A)(888)
    uncompressed, RLE
ZSoft Paintbrush images (*.pcx, *.pcc; *.scr)
    1..8 bits per sample
    grayscale, indexed, RGB
    uncompressed, RLE
Kodak Photo-CD images (*.pcd)
    8 bits per sample in YCbCr in any resolution (192 x 128 up to 6144 x 4096)
Portable pixel/gray map images (*.ppm, *.pgm, *.pbm)
    1 and 8 bits per sample
    grayscale, indexed, RGB uncompressed
Dr. Halo images (*.cut, *.pal)
    8 bits per sample indexed, RLE compressed
CompuServe images (*.gif)
    1, 4, 8 bits per sample indexed, LZW compressed
SGI Alias/Wavefront images (*.rla, *.rpf)
    8 bits per sample RGB(A), RLE compressed
Standard Windows bitmap images (*.bmp, *.rle, *.dib)
Photoshop images (*.psd, *.pdd)
    1, 8, 16 bits per sample
    indexed, RGB, CMYK, CIE L*a*b*
    uncompressed and packed bits
Paintshop Pro images (*.psp)
    1, 4, 8 bits per sample
    indexed, grayscale, RGB
    uncompressed, RLE and LZ77
    single-layered files only!
Portable network graphic images (*.png)
    1, 2, 4, 8, 16 bits per sample
    indexed, grayscale alpha, RGB(A), LZ77 compressd

IDE and compiler versions

Library was tested under various IDE from Delphi 7 up to Delphi 10 Seattle, both win32 and win64. Right now, it works only with VCL, but support of FMX is also planned in some near future.

Compilation

Almost all the code here is native Delphi code, so compiling is straight forward. The only exception is DelphiZlib which is included in this repository as 3rd party. Good thing, it is already compiled for both win32 and win64, so C compiler is not necessary after all, Delphi is enough.

Just add all the units in root folder of GraphicEx to your project and also from subfolders and that's it. Now all the graphic formats are available: line like

Image1.Picture.LoadFromFile(OpenPictureDialog1.Filename);

is everything which is needed to load any of files listed above.

Multi-language support

Recent version greatly simplifies writing international application: there is just no worries about translating GraphicEx strings and error messages: they are already translated and will be fetched in correct language at runtime. So far, there are translations to German, French, Italian, Spanish, Catalan, Polish and Russian and even two English versions: US and UK which differ by spelling of 'color'.