Re: [GM-help] Equivalent to IM's Fx operator? Or how to apply a color lookup table?
Swiss army knife of image processing
Brought to you by:
bfriesen
From: Bob F. <bfr...@si...> - 2009-09-30 23:31:34
|
On Wed, 30 Sep 2009, Evan Kaufman wrote: > I'm porting some code that currently uses ImageMagick, and I was > wondering if GM has any equivalent to IM's Fx operator. > > Specifically, I want to apply a mathematical formula to one image > using the data of another image. The formula I used with > Imagemagick is "v.p{0,u*v.h}", which breaks down as follows: > > for each pixel in image u, multiply its channels by the height of image v. > this results in a height offset we'll call w. > the color at the given offset in image v (x=0, y=w) is then used for the current pixel in image u. GraphicsMagick does not have anything like ImageMagick's Fx operator. > The end result of this is to apply a color lookup table, and though > I notice that a -hald-clut option has been added in recent versions, > I'm wanting to support older versions of GM as well. What would be > the best way to accomplish something like this? Another way to apply a LUT is via an ICC ICM color profile (-profile option). You can use a profile generator to create the profile (a file) and then use it to apply a LUT to the image. Any GraphicsMagick which is linked with lcms supports -profile. Bob -- Bob Friesenhahn bfr...@si..., http://www.simplesystems.org/users/bfriesen/ GraphicsMagick Maintainer, http://www.GraphicsMagick.org/ |