in reply to Changing image colours - Image::Magick?

From the online docs for Image::Magick it seems that the function you're currently uses simply fills the entire image with your selected colour

It looks to me like you need to look into the function ColorFloodfill, which replaces paticular pixels with your new specified colour.

Hope this helps

- wil
  • Comment on (wil) Re: Changing image colours - Image::Magick?

Replies are listed 'Best First'.
Re: Re: Changing image colours - Image::Magick?
by George_Sherston (Vicar) on May 13, 2002 at 14:55 UTC
    Yes, I see that wd do what I want, *but* my image has several different, unconnected areas of black (i.e. letters) which I want to turn into blue, and as I read ColorFloodfill, I wd have to specify a pixel in each of these, which wd be laborious. Is it the right kind of laziness to want a method that will turn all black pixels blue??

    PS - what is the "color" parameter for in method Colorize? - the same thing happens whatever I set this to!

    § George Sherston
      Hi

      From what I can see you have to define the exact coordinates of the pixel that needs rendering. The same goes for Image::XPM and others.

      I hate to say this, but, do you have to use Perl for this solution? A lot of graphic packages have batch conversion tools these days. You could make changes to the colour pallete and batch convert a number of images from there.

      - wil