Apache License 2.0

项目介绍

exilon/QuickImageFX 是一个托管在 GitHub 上的开源项目,主要使用 Pascal 编写,采用 Apache License 2.0 许可证,目前获得 96 个 Star、29 次 Fork。

仓库全名
exilon/QuickImageFX
开源许可证
Apache License 2.0
Star 数
96
Fork 数
29
未关闭 Issue
4

README 摘要

Delphi library for simplifying image load/save, conversion and transformation. Can load/save png, jpg, jxl, webp, avif, tiff, gif and bmp. Can get image from different resources: file, stream, http, imagelist, associated windows icon, executable file icon, etc... Rotate, flip, grayscale and many other transformations. GDI+, Graphics32, OpenCV, Vampyre and LibVips engines available. Give it a star Please "star" this…

完整内容见 GitHub 原始 README 或本页 。

常见问题

QuickImageFX 用什么语言开发?

主要使用 Pascal 编写,采用 Apache License 2.0 许可证,目前有 96 个 Star。

QuickImageFX 可以免费商用吗?

仓库采用 Apache License 2.0 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 QuickImageFX 的源码?

可以直接克隆仓库:git clone https://github.com/exilon/QuickImageFX.git,默认分支为 master;安装与运行步骤见仓库 README。

QuickImageFX 最近还在维护吗?

仓库最近一次更新为 2025年4月29日,当前有 4 个未关闭 Issue;Star 数为 96,可作为社区活跃度的参考。

关于

Simplifying image manipulation using GDI, Graphics32, OpenCV or Vampyre Imaging libraries

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

语言占比

Pascal

贡献者

README

alt text

Delphi library for simplifying image load/save, conversion and transformation. Can load/save png, jpg, jxl, webp, avif, tiff, gif and bmp. Can get image from different resources: file, stream, http, imagelist, associated windows icon, executable file icon, etc… Rotate, flip, grayscale and many other transformations. GDI+, Graphics32, OpenCV, Vampyre and LibVips engines available.

Give it a star

Please “star” this project in GitHub! It costs nothing but helps to reference the code. alt text

Star History

Star History Chart

Support

If you find this project useful, please consider making a donation.

paypal

*NEW: Delphi 12 Athens support

*NEW: LibVips engine added

*NEW: Interface based

*NEW: Vampyre lib engine added

*NEW: New functions added

*NEW: Refactory classes

*NEW: Delphinus support


You can select one or more of the available engines ImageFX supports. Add one or more of below units to your uses clause:

Create: Create instance of ImageFX to load/manipulate images.

var
  ImageFX : IImageFX;
begin
  ImageFX := TImageFXGDI //You can create as TImageFXGDI, TImageFXGR32, TImageFXOpenCV or TImageFXVampyre to use different graphic engines
  ImageFX.LoadFromFile('.\test.jpg');
  ImageFX.Rotate90;
  ImageFX.SaveAsPNG('.\Test.png');
end;

Load/Save: Can load/save png, jpg, gif and bmp and get image from different resources like file, stream, http, imagelist, associated windows icon, executable file icon, etc…

//Load image from files like jpg, gif, png and bmp
ImageFX.LoadFromFile('.\file.jpg');
	
//Load/Save image from/to a memorystream, filestream, etc...
ImageFX.LoadFromStream(MyStream);
ImageFX.SaveToStream(MyStream,ifJPG);
	
//Load image from an icon class
ImageFX.LoadFromIcon(MyIcon);
	
//Load image from an icon file
ImageFX.LoadFromFileIcon('.\file.ico');
	
//Get image associated in windows with this type of extension
ImageFX.LoadFromFileExtension('.\file.xls',True);
	
//Load from exe resource
ImageFX.LoadFromResource('Main.ico');
	
//Get image from a http link
ImageFX.LoadFromHTTP('http://www.mysite.com/file.jpg',ReturnHTTPCode,True);
	
//Load/Save from string
ImageFX.LoadFromString(MyImageString);
ImageFX.SaveToString(MyImageString);

Image Info: Get resolution, aspect ratio of an image.

ImageFX.GetResolution(x,y)
ImageFX.AspectRatioStr //aspect ratio (4:3,16:9)
ImageFX.IsGray

Image Resize:

//Resize image to fit max bounds of 500x300 and fills rest of target size with a border black color
ImageFX.ResizeOptions.BorderColor := clBlack; 
ImageFX.Resize(500,300, rmFitToBounds, [rfCenter], rmLinear);

//Same image resize alternative/advanced mode
ImageFX.ResizeOptions.ResamplerMode := rmLinear;
ImageFX.ResizeOptions.ResizeMode := rmFitToBounds;
ImageFX.ResizeOptions.Center := True;
ImageFX.ResizeOptions.FillBorders := True;
ImageFX.ResizeOptions.BorderColor := clBlack;
ImageFX.Resize(500,300);

ResizeOptions:

  • NoMagnify: If true not resize image if smallest than especified new size.

  • ResizeMode: Resize algorithms to calculate desired final size:

    • rmStretch Stretch original image to fit target size without preserving original aspect ratio.
    • rmScale Recalculate width or height target size to preserve original aspect ratio.
    • rmCropToFill Preserve target aspect ratio cropping original image to fill whole size.
    • rmFitToBounds Resize image to fit max bounds of target size.
  • ResamplerMode: Resize algorithms to be applied:

    • rsAuto Uses rmArea for downsampling and rmLinear for upsampling
    • rsGDIStrech GDI only mode.
    • rsNearest Low quality - High performance.
    • rsGR32Draft GR32 only. Medium quality - High performance (downsampling only).
    • rsOCVArea OpenCV only. Medium quality - High performance (downsampling only).
    • rsLinear Medium quality - Medium performance.
    • rsGR32Kernel GR32 only. High quality - Low performance (depends on kernel width).
    • rsOCVCubic OpenCV only. High quality - Medium/Low performance.
    • rsOCVLanczos4 OpenCV only. High quality - Low performance.
  • Center: Centers image

  • FillBorders: Fill borders of a scaled image in destination rectangle if smaller.

  • BorderColor: Color of filling borders.

Transforms: Apply rotations, flips, scanline effects, bright and others transformations to your images.

//Rotate image 90 degrees
ImageFX.Rotate90;
    
//Rotate image 45 degrees
ImageFX.RotateAngle(45);
    
//Convert to grayscale
ImageFX.GrayScale;
    
//Flip image horizontally
ImageFX.FlipX;
    
//Increase bright by 50%
ImageFX.Lighten(50);
    
//Change color of a pixel
PixInfo.R := Random(255); //R
PixInfo.G := Random(255); //G
PixInfo.B := Random(120); //B
PixInfo.A := 200; //Alpha
imageFX.Pixel[x,y] := PixInfo;
    
//Draw an overlay image over current image with 50% transparency
ImageFX.DrawCentered(pngimage,0.5);

Format conversions: Can convert between image formats.

ImageFX.LoadFromFile('.\myfile.jpg');
ImageFX.SaveAsPNG('.\myfile.png');

Almost all functions return self class, so you can chain many actions and effects like this:

//Rotate 90 degrees and flip horizontally, convert to grayscale and save to a png file.
ImageFX.Rotate90.FlipX.GrayScale.SaveToPNG('.\myfile.png');
        
// Load from file, rotate180, resize to 100x100 and assign to a TImage.    
MyImage.Picture.Asssign(ImageFX.LoadFromFile('.\myfile.jpg').Rotate180.Resize(100,100).AsBitmap);

Do you want to learn delphi or improve your skills? learndelphi.org

评论

暂无评论