Background Gradient with Magick++
-
21-09-2019 - |
문제
How do I create gradients with ImageMagick in C++?
I am trying to create a visual representation of a WAV file.
I can create an Image with Magick++, draw in the waveform data and save the image as a .png file but it still looks a bit basic.
I'd like to give the image background and waveform gradients but I don't know how.
Are there any examples of how to create gradients using Magick++?
Many thanks, Josh
해결책
I believe you would have to use the Pixel class and interpolate Colors to create your own gradient fill.
The manual for Magick++ does not indicate that it has native functions for gradient fill.
It may also be possible to use the core ImageMagick API for gradient fill.
Here's some useful links:
- http://www.imagemagick.org/Usage/canvas/
- http://softwareas.com/imagemagick-one-second-gradient-images
Edit - The Magick Core API does have a DrawGradientImage function which may help you out.
Here's some more useful links: