Histogram levels

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
praviarun

Histogram levels

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Histogram levels

Post 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
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Histogram levels

Post 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!
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Histogram levels

Post by fmw42 »

I think he wants to have only a few point that are spline interpolated to fill out the lut for clut
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Histogram levels

Post by anthony »

Oh you mean like curve fitting...
http://www.imagemagick.org/Usage/color/#curves

Apologies
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
praviarun

Re: Histogram levels

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Histogram levels

Post 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.
Post Reply