magickwand-crystal
Version, currently 0.3.07 versions
github.com/blocknotes/magickwand-crystal
Crystal C bindings for MagickWand library
Installation
# Add this to your shard.yml
dependencies:
magickwand-crystal:
github: blocknotes/magickwand-crystal
version: ~> 0.3.0Then run:
shards installshard.yml
- Crystal
0.31.0- License
- MIT
- Authors
- Mattia Roccoberton, Gunter Solf
Dependencies
This version declares no dependencies.
README
MagickWand for Crystal 
Crystal C bindings for MagickWand library, an interface to use the ImageMagick image processing libraries - see www.imagemagick.org
NOTE: Base on ImageMagick-7.0.8-66. MagickWand is a quite large library, if you find something missing contact me
Requirements
- libMagickWand must be installed
- pkg-config must be available
Installation
- Add this to your application's
shard.yml:
dependencies:
magickwand-crystal:
github: blocknotes/magickwand-crystal
Usage
Get image info:
require "magickwand-crystal"
LibMagick.magickWandGenesis # lib init
wand = LibMagick.newMagickWand # lib init
if LibMagick.magickReadImage( wand, "test.png" )
puts LibMagick.magickGetImageWidth wand
puts LibMagick.magickGetImageHeight wand
end
LibMagick.destroyMagickWand wand # lib deinit
LibMagick.magickWandTerminus # lib deinit
Scale image and save in Jpeg format:
require "magickwand-crystal"
# ... lib init ...
LibMagick.magickReadImage wand, "test.png"
LibMagick.magickScaleImage wand, 320, 240
LibMagick.magickWriteImage wand, "test2.jpg"
# ... lib deinit ...
Convert to grayscale:
require "magickwand-crystal"
# ... lib init ...
LibMagick.magickReadImage wand, "test.jpg"
LibMagick.magickTransformImageColorspace wand, LibMagick::ColorspaceType::GRAYColorspace
LibMagick.magickWriteImage wand, "grayscale.jpg"
# ... lib deinit ...
More examples
See examples folder. There is also an example to generate an image on the fly with Kemal.
Documentation
The functions mapped have the same names of the MagickWand C library but with the first letter in lowercase.
Example: MagickWandGenesis => LibMagick.magickWandGenesis
Notes
Branches with different ImageMagick version:
- im_6.9.7-3
- im_7.0.4-1
The Crystal Magic Wand ! :)
Sounds funny but I hope you find it a useful piece of software.
Contributors
- Mattia Roccoberton - creator, maintainer, Crystal fan :)
Documentation
Built from the current release. The first visit to a release nobody has asked for starts its build.
Links
This release
- Version
0.3.0- Tagged
- Oct 8, 2019
- Commit
419024b550d1- Crystal
0.31.0- Indexed
- yes
Dependents
Repository
github.com/blocknotes/magickwand-crystal
Metadata
- Created
- Aug 12, 2026
- Updated
- Oct 24, 2026
- Synced
- Oct 24, 2026
- Versions
- 7