Page 1 of 1

Histogram levels

Posted: 2009-08-27T05:40:54-07:00
by praviarun
Hi,

I would like to have finer control on applying levels on an image using the magick C++ api..
I would like to give a bezier curve as an input to specify how the level
has to be applied...
I know I could do it with the magick++ fx function but am not sure as to how to go about it...
Could some one help me...

Regards
Praveen

Re: Histogram levels

Posted: 2009-08-27T08:34:40-07:00
by fmw42
I don't know anything about C++, but I have programmed a bash script to do something like that using splines and -clut. see my script, curves

Re: Histogram levels

Posted: 2009-08-27T21:12:17-07:00
by anthony
If the curver can be described as a list of numbers, then that can be converted into a culumitive histogram, and appied using the same histogram re-directibution technique used for Gaussian Histogram re-distribution.

http://www.imagemagick.org/Usage/colors ... ian_redist

Yes we are working toward having this built into ImageMagick!

Re: Histogram levels

Posted: 2009-08-27T21:57:57-07:00
by fmw42
I think he wants to have only a few point that are spline interpolated to fill out the lut for clut

Re: Histogram levels

Posted: 2009-08-27T22:36:05-07:00
by anthony
Oh you mean like curve fitting...
http://www.imagemagick.org/Usage/color/#curves

Apologies

Re: Histogram levels

Posted: 2009-08-27T23:56:20-07:00
by praviarun
Hi,
Thanks to all,

Yes,I would like to do curve fitting...
I looked at that example but that requires me to pass a mathematical formula to magick which means I need to use some external library...
Is that the only way I can achieve this effect....

Regards
Praveen

Re: Histogram levels

Posted: 2009-08-28T09:07:27-07:00
by fmw42
probably unless your points are equally spaced. then you can use -filter to interpolate them

convert -list filter

Bartlett
Bessel
Blackman
Bohman
Box
Catrom
Cubic
Gaussian
Hamming
Hanning
Hermite
Kaiser
Lagrange
Lanczos
Mitchell
Parzen
Point
Quadratic
Sinc
Triangle
Welsh


see my rainbow example at http://www.fmwconcepts.com/imagemagick/ ... hp#rainbow where I took a handful of point colors and interpolated them using a cubic filter to fill it out to 600 pixels wide.

This does not work if you have unevenly spaced points.