Image32 Library (open source)

Came across this library today

Docs - Image32 Library

Anyone tried it? It looks very good so far, but I’ve only had a quick browse - haven’t tried it yet.

I’m looking to replace (a very old version of) ImageEn - I would upgrade it but I need a library that is not tied to the vcl (need to run from a console app in a docker container) - unfortunately as good as ImageEn is - it’s very much tied to the vcl.

I’ve used graphics32 in the past

There’s a, sort of, comparison, discussion, here https://en.delphipraxis.net/topic/4207-what-is-the-future-roadmap-of-graphics32/

Thanks for that. I’ve tried to make sense of Graphics32 but the project seems to be in a bit of disarray right now - and I can’t quite figure out if it can do what I need without pulling in the vcl. More research needed.

Graphics32 is dependent on the VCL but Image32 is not.
Image32 is dependent on either FMX or VCL for GIF, PNG and JPG file access, but not for the other formats (BMP, SVG). Apart from this file access, the library has no dependencies.

Anyone tried it?

I have, and it seems pretty good :stuck_out_tongue_winking_eye:.
Greetings from Brisbane. :raising_hand_man:t2:

1 Like

Haha, welcome Angus!

Any dependency on the vcl is a deal breaker for console apps that need to run under docker containers - the windows docker images are missing some of the windows dll’s that the vcl is statically linked to - so even if you don’t use the features the application will not run.

It’s only a small feature in FinalBuilder (1 action, which very few likely use) - so it looks like I may have to sacrifice it in order to get docker compatibiliy.

Could you not just use BMP and SVG files with Image32?

It’s an existing featrure (in v8, working on v9) that does image resizing, rotating etc and supports bmp, png, jpeg etc. So I either need to support all the existing functionality (without using the vcl) or remove the feature.

1 Like

Someone did a port of GR32 to work with FMX several years ago. I’ve used it successfully, although it hasn’t been maintained.

Python script any use as a temporary solution?

Perhaps, I don’t know much about the python libs for image processing. I’d much rather have a native code solution if possible.

I’d much rather have a native code solution if possible.

It would be pretty easy to make a custom Img32.Fmt.JPG unit that uses LibTurboJPEG.pas (and a DLL) from

Edit: Here’s a non-VCL JPG module for Image32 …
Img32.Fmt.JPG.zip (466.6 KB)

And here’s a cutdown version of PngImage.pas that’s no longer dependent on the VCL. Img32.Fmt.PNG.pas will be able to use this modified file without modification.
(This is just a sample mod to show you how to modify you’re own delphi source code. I won’t be including this in Image32 since it would be infringing the Delphi license. Alternatively you could comment out the UseDelphi conditional define in Vcl.Imaging.pngimage.pas but it still requires quite a bit of work to get the unit to compile.)
pngimage.zip (30.4 KB)

1 Like

I was looking at
GitHub - jarun/imgp: Fast batch image resizer and rotator
GitHub - python-pillow/Pillow: The friendly PIL fork (Python Imaging Library)

Thanks @angusj - that looks promising - I will definitely look at this idea.

Image32 version 3.3 released.

Download:

1 Like

I can’t build it because it requires an undeclared type: TSvgPaths.
I downloaded the release-tagged zip.

Thanks Andrea. I’ll check it again.

Edit: Oops, I failed to update the SVG201 demo. I’ll fix immediately.
Edit2: Fixed now.

1 Like

Yo dude,

here is the offending code:

 TSvgPathWriter = class(TExBaseElWriter)
  private
    fLastPt   : TPointD;
    fSvgPaths : TSvgPaths;
    function GetPathCount: integer;
    function GetCurrentPath: PSvgPath;
    function GetNewPath: PSvgPath;
    function GetNewOrAppendSeg(path: PSvgPath; segType: TSvgPathSegType): PSvgPathSeg;
    procedure AddSegmentValues(seg: PSvgPathSeg;
      const values: array of Double);

TSvgPaths is given as an undeclared type.
If I search the whole project group:
image
This is Delphi 11 Alexandria by the way but I expect every single other package to fail provided that the type is actually nowhwere to be found in the whole group :smiley:

As you can probably surmise, i redownloaded it and tried again, but still same result.