Xavier Denis
Xavier Denis

Reputation: 426

Quantizing to same base colors in RMagick

In RMagick you can call the quantize function which reduces the colors in the original image. I was wondering if there was any way for force a specific color palette onto the image. I'm processing thousands of images and I want to be able to compare them to each other, which means I will need them to have the the same colors after the quantize call. Is there a way to impose a color palette or something similar in RMagick?

Upvotes: 0

Views: 455

Answers (1)

An RMagick User
An RMagick User

Reputation: 354

Check out the #quantize method in the ImageList class. It quantizes all the images in the list to the same set of colors. Also, the ImageList#remap and Image#remap methods remap the image(s) to the set of colors specified by a reference image.

Upvotes: 1

Related Questions