https://github.com/qoretechnologies/module-imagemagick
Qore ImageMagick module for image processing and manipulation
https://github.com/qoretechnologies/module-imagemagick
Last synced: about 1 month ago
JSON representation
Qore ImageMagick module for image processing and manipulation
- Host: GitHub
- URL: https://github.com/qoretechnologies/module-imagemagick
- Owner: qoretechnologies
- License: mit
- Created: 2026-02-14T16:58:00.000Z (6 months ago)
- Default Branch: develop
- Last Pushed: 2026-06-05T18:14:39.000Z (about 2 months ago)
- Last Synced: 2026-06-05T20:08:53.886Z (about 2 months ago)
- Language: QuakeC
- Size: 314 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Qore imagemagick Module
## Introduction
The `imagemagick` module provides comprehensive image processing and manipulation capabilities
for Qore by wrapping the ImageMagick MagickWand C API, including:
- Loading and saving images in 200+ formats (PNG, JPEG, GIF, TIFF, WebP, etc.)
- Resize, crop, rotate, flip, and other geometric transformations
- Color adjustment (brightness, contrast, gamma, levels, modulate)
- Effects (blur, sharpen, charcoal, sepia, oil paint, edge detection, emboss)
- Vector drawing (shapes, text, paths) via MagickDrawing
- Image compositing with multiple blend modes
- Metadata access (EXIF, ICC profiles, properties)
- Format conversion with quality control
- Data provider module for integration with Qore's data provider framework
## Requirements
- Qore 2.0+
- CMake 3.5+
- C++11 compiler
- ImageMagick 7.0+ with MagickWand development libraries
## Building
```bash
mkdir build
cd build
cmake ..
make
make install
```
## Quick Start
```qore
#!/usr/bin/qore
%modern
%requires imagemagick
# Load and resize an image
MagickImage img("photo.jpg");
img.resize(800, 600, "Lanczos");
img.writeFile("photo_resized.jpg");
# Format conversion
MagickImage img2("document.png");
binary jpeg_data = img2.toData("JPEG");
# Apply effects
MagickImage img3("photo.jpg");
img3.charcoal(1.0, 0.5);
img3.writeFile("charcoal.jpg");
# Draw shapes and text
MagickDrawing dw();
dw.setFillColor("blue");
dw.rectangle(10.0, 10.0, 100.0, 100.0);
dw.setFontSize(24.0);
dw.annotation(50.0, 150.0, "Hello!");
MagickImage canvas(300, 300, "white");
canvas.draw(dw);
canvas.writeFile("drawing.png");
# Get image info
MagickImage img4("photo.jpg");
hash info = img4.getInfo();
printf("Size: %dx%d, Format: %s\n", info.width, info.height, info.format);
```
## Data Provider
The module includes `ImageMagickDataProvider` for use with Qore's data provider framework:
```qore
%modern
%requires ImageMagickDataProvider
# Resize an image
AbstractDataProvider dp = DataProvider::getFactoryObjectFromStringEx("imagemagick{}/image/resize");
hash result = dp.doRequest({
"input_path": "photo.jpg",
"width": 800,
"height": 600,
});
# Get image info
AbstractDataProvider info = DataProvider::getFactoryObjectFromStringEx("imagemagick{}/info/get");
hash metadata = info.doRequest({
"input_path": "photo.jpg",
});
printf("Format: %s, Size: %dx%d\n", metadata.format, metadata.width, metadata.height);
```
## License
MIT License - see [LICENSE](LICENSE) for details.
## Copyright
Copyright 2026 Qore Technologies, s.r.o.