I’m currently stuck on a – more or less – simple task. I need to replace some colors with other colors in an image using rmagick.
I found two approaches.
- Looping through every pixel to replace it’s color
- Color to alpha, set background color, save as new image.
Is there a better solution?
Finally, I found the answer myself:
Using Magick::Image#opaque_channel