CrystalVips Provides Crystal language interface to the libvips image processing library. Programs that use CrystalVips don’t manipulate images directly, instead they create pipelines of image processing operations starting from a source image. When the pipe is connected to a destination, the whole pipeline executes at once and in parallel, streaming the image from source to destination in a set of small fragments.
Because CrystalVips is parallel, its’ quick, and because it doesn’t need to keep entire images in memory, its light.
This is a fantastic contribution to the community, thank you! Folks drop by the chat frequently looking for imagemagick or graphicsmagick bindings, it’ll be nice to be able to point them here.
Exactly. Since libvips uses far less memory and is a lot faster than anything else, even more when comparing with imagemagick and graphicsmagick, there is no reason to not use CrystalVips to process images on Crystal.
This is a great library.
I asked ChatGPT to write code to draw the Mandelbrot set (for fun). Here we are first creating a pnm image and then converting it to a PNG. Can we create a PNG from the beginning?
You can operate on the Image and once done with transformation/operations, then save that to format of your choice.
below sample using your provided mandelbrot_set method to generate array of values, then creating image from that array. Image created such way will be BW, so let’s invoke LibVips::vips_falsecolour to perform some band transformation.