1 2 3 4 5<!doctype html> 6<html lang="en"> 7<head> 8 <meta charset="utf-8" /> 9 <meta name="viewport" content="width=device-width, initial-scale=1" /> 10 <title>ImageMagick - MagickCore, C API: Enhance an Image</title> 11 <meta name="application-name" content="ImageMagick" /> 12 <meta name="description" content="Use ImageMagick® to create, edit, compose, and convert digital images. Resize an image, crop it, change its shades and colors, add captions, and more." /> 13 <meta name="application-url" content="https://imagemagick.org" /> 14 <meta name="generator" content="PHP" /> 15 <meta name="keywords" content="magickcore, c, api:, enhance, an, image, image processing software" /> 16 <meta name="rating" content="GENERAL" /> 17 <meta name="robots" content="INDEX, FOLLOW" /> 18 <meta name="generator" content="ImageMagick Studio LLC" /> 19 <meta name="author" content="ImageMagick Studio LLC" /> 20 <meta name="revisit-after" content="2 DAYS" /> 21 <meta name="resource-type" content="document" /> 22 <meta name="copyright" content="Copyright (c) 1999-2020 ImageMagick Studio LLC" /> 23 <meta name="distribution" content="Global" /> 24 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" /> 25 <meta property='og:url' content='../../' /> 26 <meta property='og:title' content='ImageMagick' /> 27 <meta property='og:image' content='../../../images/logo.png' /> 28 <meta property='og:type' content='website' /> 29 <meta property='og:site_name' content='ImageMagick' /> 30 <meta property='og:description' content="Create, Edit, Compose, or Convert Digital Images" /> 31 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> 32 <link href="enhance.html" rel="canonical" /> 33 <link href="../../../images/wand.png" rel="icon" /> 34 <link href="../../../images/wand.ico" rel="shortcut icon" /> 35 <link href="../../assets/magick.css" rel="stylesheet" /> 36</head> 37<body> 38 <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top"> 39 <div class="container-fluid"> 40 <a class="navbar-brand" href="../../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../../../images/wand.ico"/></a> 41 <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#magick-navbars" aria-controls="magick-navbars" aria-expanded="false" aria-label="Toggle navigation"> 42 <span class="navbar-toggler-icon"></span> 43 </button> 44 45 <div class="collapse navbar-collapse" id="magick-navbars"> 46 <ul class="navbar-nav me-auto mb-2 mb-md-0"> 47 <li class="nav-item"> 48 <a class="nav-link " href="../../www/index.html">Home</a> 49 </li> 50 <li class="nav-item"> 51 <a class="nav-link " href="../../www/download.html">Download</a> 52 </li> 53 <li class="nav-item"> 54 <a class="nav-link " href="../../www/command-line-tools.html">Tools</a> 55 </li> 56 <li class="nav-item"> 57 <a class="nav-link " href="../../www/command-line-processing.html">CLI</a> 58 </li> 59 <li class="nav-item"> 60 <a class="nav-link " href="../../www/develop.html">Develop</a> 61 </li> 62 <li class="nav-item"> 63 <a class="nav-link" target="_blank" href="https://github.com/ImageMagick/ImageMagick/discussions">Community</a> 64 </li> 65 <li class="nav-item"> 66 <iframe src="https://github.com/sponsors/ImageMagick/button" title="Sponsor ImageMagick" height="35" width="107" style="border: 0;"></iframe> 67 </li> 68 </ul> 69 <form class="d-flex form-inline" action="https://imagemagick.org/script/search.php"> 70 <input class="form-control me-2" type="text" name="q" placeholder="Search" aria-label="Search"> 71 <button class="btn btn-outline-success" type="submit" name="sa">Search</button> 72 </form> 73 </div> 74 </div> 75 </nav> 76 77 <div class="container"> 78 <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script> 79 <ins class="adsbygoogle" 80 style="display:block" 81 data-ad-client="ca-pub-3129977114552745" 82 data-ad-slot="6345125851" 83 data-full-width-responsive="true" 84 data-ad-format="horizontal"></ins> 85 <script> 86 (adsbygoogle = window.adsbygoogle || []).push({}); 87 </script> 88 89 </div> 90 91 <main class="container"> 92 <div class="magick-template"> 93<div class="magick-header"> 94<p class="text-center"><a href="enhance.html#AutoGammaImage">AutoGammaImage</a> • <a href="enhance.html#AutoLevelImage">AutoLevelImage</a> • <a href="enhance.html#BrightnessContrastImage">BrightnessContrastImage</a> • <a href="enhance.html#CLAHEImage">CLAHEImage</a> • <a href="enhance.html#ClutImage">ClutImage</a> • <a href="enhance.html#ColorDecisionListImage">ColorDecisionListImage</a> • <a href="enhance.html#ContrastImage">ContrastImage</a> • <a href="enhance.html#ContrastStretchImage">ContrastStretchImage</a> • <a href="enhance.html#EnhanceImage">EnhanceImage</a> • <a href="enhance.html#EqualizeImage">EqualizeImage</a> • <a href="enhance.html#GammaImage">GammaImage</a> • <a href="enhance.html#GrayscaleImage">GrayscaleImage</a> • <a href="enhance.html#HaldClutImage">HaldClutImage</a> • <a href="enhance.html#LevelImage">LevelImage</a> • <a href="enhance.html#LevelizeImage">LevelizeImage</a> • <a href="enhance.html#LevelImageColors">LevelImageColors</a> • <a href="enhance.html#LinearStretchImage">LinearStretchImage</a> • <a href="enhance.html#ModulateImage">ModulateImage</a> • <a href="enhance.html#NegateImage">NegateImage</a> • <a href="enhance.html#The NormalizeImage">The NormalizeImage</a> • <a href="enhance.html#SigmoidalContrastImage">SigmoidalContrastImage</a> • <a href="enhance.html#WhiteBalanceImage">WhiteBalanceImage</a></p> 95 96<h2><a href="../../api/MagickCore/enhance_8c.html" id="AutoGammaImage">AutoGammaImage</a></h2> 97 98<p>AutoGammaImage() extract the 'mean' from the image and adjust the image to try make set its gamma appropriately.</p> 99 100<p>The format of the AutoGammaImage method is:</p> 101 102<pre class="text"> 103MagickBooleanType AutoGammaImage(Image *image,ExceptionInfo *exception) 104</pre> 105 106<p>A description of each parameter follows:</p> 107 108<dd> 109</dd> 110 111<dd> </dd> 112<dl class="dl-horizontal"> 113<dt>image</dt> 114<dd>The image to auto-level </dd> 115 116<dd> </dd> 117<dt>exception</dt> 118<dd>return any errors or warnings in this structure. </dd> 119 120<dd> </dd> 121</dl> 122<h2><a href="../../api/MagickCore/enhance_8c.html" id="AutoLevelImage">AutoLevelImage</a></h2> 123 124<p>AutoLevelImage() adjusts the levels of a particular image channel by scaling the minimum and maximum values to the full quantum range.</p> 125 126<p>The format of the LevelImage method is:</p> 127 128<pre class="text"> 129MagickBooleanType AutoLevelImage(Image *image,ExceptionInfo *exception) 130</pre> 131 132<p>A description of each parameter follows:</p> 133 134<dd> 135</dd> 136 137<dd> </dd> 138<dl class="dl-horizontal"> 139<dt>image</dt> 140<dd>The image to auto-level </dd> 141 142<dd> </dd> 143<dt>exception</dt> 144<dd>return any errors or warnings in this structure. </dd> 145 146<dd> </dd> 147</dl> 148<h2><a href="../../api/MagickCore/enhance_8c.html" id="BrightnessContrastImage">BrightnessContrastImage</a></h2> 149 150<p>BrightnessContrastImage() changes the brightness and/or contrast of an image. It converts the brightness and contrast parameters into slope and intercept and calls a polynomical function to apply to the image.</p> 151 152<p>The format of the BrightnessContrastImage method is:</p> 153 154<pre class="text"> 155MagickBooleanType BrightnessContrastImage(Image *image, 156 const double brightness,const double contrast,ExceptionInfo *exception) 157</pre> 158 159<p>A description of each parameter follows:</p> 160 161<dd> 162</dd> 163 164<dd> </dd> 165<dl class="dl-horizontal"> 166<dt>image</dt> 167<dd>the image. </dd> 168 169<dd> </dd> 170<dt>brightness</dt> 171<dd>the brightness percent (-100 .. 100). </dd> 172 173<dd> </dd> 174<dt>contrast</dt> 175<dd>the contrast percent (-100 .. 100). </dd> 176 177<dd> </dd> 178<dt>exception</dt> 179<dd>return any errors or warnings in this structure. </dd> 180 181<dd> </dd> 182</dl> 183<h2><a href="../../api/MagickCore/enhance_8c.html" id="CLAHEImage">CLAHEImage</a></h2> 184 185<p>CLAHEImage() is a variant of adaptive histogram equalization in which the contrast amplification is limited, so as to reduce this problem of noise amplification.</p> 186 187<p>Adapted from implementation by Karel Zuiderveld, karel@cv.ruu.nl in "Graphics Gems IV", Academic Press, 1994.</p> 188 189<p>The format of the CLAHEImage method is:</p> 190 191<pre class="text"> 192MagickBooleanType CLAHEImage(Image *image,const size_t width, 193 const size_t height,const size_t number_bins,const double clip_limit, 194 ExceptionInfo *exception) 195</pre> 196 197<p>A description of each parameter follows:</p> 198 199<dd> 200</dd> 201 202<dd> </dd> 203<dl class="dl-horizontal"> 204<dt>image</dt> 205<dd>the image. </dd> 206 207<dd> </dd> 208<dt>width</dt> 209<dd>the width of the tile divisions to use in horizontal direction. </dd> 210 211<dd> </dd> 212<dt>height</dt> 213<dd>the height of the tile divisions to use in vertical direction. </dd> 214 215<dd> </dd> 216<dt>number_bins</dt> 217<dd>number of bins for histogram ("dynamic range"). </dd> 218 219<dd> </dd> 220<dt>clip_limit</dt> 221<dd>contrast limit for localised changes in contrast. A limit less than 1 results in standard non-contrast limited AHE. </dd> 222 223<dd> </dd> 224<dt>exception</dt> 225<dd>return any errors or warnings in this structure. </dd> 226 227<dd> </dd> 228</dl> 229<h2><a href="../../api/MagickCore/enhance_8c.html" id="ClutImage">ClutImage</a></h2> 230 231<p>ClutImage() replaces each color value in the given image, by using it as an index to lookup a replacement color value in a Color Look UP Table in the form of an image. The values are extracted along a diagonal of the CLUT image so either a horizontal or vertial gradient image can be used.</p> 232 233<p>Typically this is used to either re-color a gray-scale image according to a color gradient in the CLUT image, or to perform a freeform histogram (level) adjustment according to the (typically gray-scale) gradient in the CLUT image.</p> 234 235<p>When the 'channel' mask includes the matte/alpha transparency channel but one image has no such channel it is assumed that that image is a simple gray-scale image that will effect the alpha channel values, either for gray-scale coloring (with transparent or semi-transparent colors), or a histogram adjustment of existing alpha channel values. If both images have matte channels, direct and normal indexing is applied, which is rarely used.</p> 236 237<p>The format of the ClutImage method is:</p> 238 239<pre class="text"> 240MagickBooleanType ClutImage(Image *image,Image *clut_image, 241 const PixelInterpolateMethod method,ExceptionInfo *exception) 242</pre> 243 244<p>A description of each parameter follows:</p> 245 246<dd> 247</dd> 248 249<dd> </dd> 250<dl class="dl-horizontal"> 251<dt>image</dt> 252<dd>the image, which is replaced by indexed CLUT values </dd> 253 254<dd> </dd> 255<dt>clut_image</dt> 256<dd>the color lookup table image for replacement color values. </dd> 257 258<dd> </dd> 259<dt>method</dt> 260<dd>the pixel interpolation method. </dd> 261 262<dd> </dd> 263<dt>exception</dt> 264<dd>return any errors or warnings in this structure. </dd> 265 266<dd> </dd> 267</dl> 268<h2><a href="../../api/MagickCore/enhance_8c.html" id="ColorDecisionListImage">ColorDecisionListImage</a></h2> 269 270<p>ColorDecisionListImage() accepts a lightweight Color Correction Collection (CCC) file which solely contains one or more color corrections and applies the correction to the image. Here is a sample CCC file:</p> 271 272<pre class="text"> 273 <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2"> 274 <ColorCorrection id="cc03345"> 275 <SOPNode> 276 <Slope> 0.9 1.2 0.5 </Slope> 277 <Offset> 0.4 -0.5 0.6 </Offset> 278 <Power> 1.0 0.8 1.5 </Power> 279 </SOPNode> 280 <SATNode> 281 <Saturation> 0.85 </Saturation> 282 </SATNode> 283 </ColorCorrection> 284 </ColorCorrectionCollection> 285</pre> 286 287<p>which includes the slop, offset, and power for each of the RGB channels as well as the saturation.</p> 288 289<p>The format of the ColorDecisionListImage method is:</p> 290 291<pre class="text"> 292MagickBooleanType ColorDecisionListImage(Image *image, 293 const char *color_correction_collection,ExceptionInfo *exception) 294</pre> 295 296<p>A description of each parameter follows:</p> 297 298<dd> 299</dd> 300 301<dd> </dd> 302<dl class="dl-horizontal"> 303<dt>image</dt> 304<dd>the image. </dd> 305 306<dd> </dd> 307<dt>color_correction_collection</dt> 308<dd>the color correction collection in XML. </dd> 309 310<dd> </dd> 311<dt>exception</dt> 312<dd>return any errors or warnings in this structure. </dd> 313 314<dd> </dd> 315</dl> 316<h2><a href="../../api/MagickCore/enhance_8c.html" id="ContrastImage">ContrastImage</a></h2> 317 318<p>ContrastImage() enhances the intensity differences between the lighter and darker elements of the image. Set sharpen to a MagickTrue to increase the image contrast otherwise the contrast is reduced.</p> 319 320<p>The format of the ContrastImage method is:</p> 321 322<pre class="text"> 323MagickBooleanType ContrastImage(Image *image, 324 const MagickBooleanType sharpen,ExceptionInfo *exception) 325</pre> 326 327<p>A description of each parameter follows:</p> 328 329<dd> 330</dd> 331 332<dd> </dd> 333<dl class="dl-horizontal"> 334<dt>image</dt> 335<dd>the image. </dd> 336 337<dd> </dd> 338<dt>sharpen</dt> 339<dd>Increase or decrease image contrast. </dd> 340 341<dd> </dd> 342<dt>exception</dt> 343<dd>return any errors or warnings in this structure. </dd> 344 345<dd> </dd> 346</dl> 347<h2><a href="../../api/MagickCore/enhance_8c.html" id="ContrastStretchImage">ContrastStretchImage</a></h2> 348 349<p>ContrastStretchImage() is a simple image enhancement technique that attempts to improve the contrast in an image by 'stretching' the range of intensity values it contains to span a desired range of values. It differs from the more sophisticated histogram equalization in that it can only apply a linear scaling function to the image pixel values. As a result the 'enhancement' is less harsh.</p> 350 351<p>The format of the ContrastStretchImage method is:</p> 352 353<pre class="text"> 354MagickBooleanType ContrastStretchImage(Image *image, 355 const char *levels,ExceptionInfo *exception) 356</pre> 357 358<p>A description of each parameter follows:</p> 359 360<dd> 361</dd> 362 363<dd> </dd> 364<dl class="dl-horizontal"> 365<dt>image</dt> 366<dd>the image. </dd> 367 368<dd> </dd> 369<dt>black_point</dt> 370<dd>the black point. </dd> 371 372<dd> </dd> 373<dt>white_point</dt> 374<dd>the white point. </dd> 375 376<dd> </dd> 377<dt>levels</dt> 378<dd>Specify the levels where the black and white points have the range of 0 to number-of-pixels (e.g. 1, 10x90, etc.). </dd> 379 380<dd> </dd> 381<dt>exception</dt> 382<dd>return any errors or warnings in this structure. </dd> 383 384<dd> </dd> 385</dl> 386<h2><a href="../../api/MagickCore/enhance_8c.html" id="EnhanceImage">EnhanceImage</a></h2> 387 388<p>EnhanceImage() applies a digital filter that improves the quality of a noisy image.</p> 389 390<p>The format of the EnhanceImage method is:</p> 391 392<pre class="text"> 393Image *EnhanceImage(const Image *image,ExceptionInfo *exception) 394</pre> 395 396<p>A description of each parameter follows:</p> 397 398<dd> 399</dd> 400 401<dd> </dd> 402<dl class="dl-horizontal"> 403<dt>image</dt> 404<dd>the image. </dd> 405 406<dd> </dd> 407<dt>exception</dt> 408<dd>return any errors or warnings in this structure. </dd> 409 410<dd> </dd> 411</dl> 412<h2><a href="../../api/MagickCore/enhance_8c.html" id="EqualizeImage">EqualizeImage</a></h2> 413 414<p>EqualizeImage() applies a histogram equalization to the image.</p> 415 416<p>The format of the EqualizeImage method is:</p> 417 418<pre class="text"> 419MagickBooleanType EqualizeImage(Image *image,ExceptionInfo *exception) 420</pre> 421 422<p>A description of each parameter follows:</p> 423 424<dd> 425</dd> 426 427<dd> </dd> 428<dl class="dl-horizontal"> 429<dt>image</dt> 430<dd>the image. </dd> 431 432<dd> </dd> 433<dt>exception</dt> 434<dd>return any errors or warnings in this structure. </dd> 435 436<dd> </dd> 437</dl> 438<h2><a href="../../api/MagickCore/enhance_8c.html" id="GammaImage">GammaImage</a></h2> 439 440<p>GammaImage() gamma-corrects a particular image channel. The same image viewed on different devices will have perceptual differences in the way the image's intensities are represented on the screen. Specify individual gamma levels for the red, green, and blue channels, or adjust all three with the gamma parameter. Values typically range from 0.8 to 2.3.</p> 441 442<p>You can also reduce the influence of a particular channel with a gamma value of 0.</p> 443 444<p>The format of the GammaImage method is:</p> 445 446<pre class="text"> 447MagickBooleanType GammaImage(Image *image,const double gamma, 448 ExceptionInfo *exception) 449</pre> 450 451<p>A description of each parameter follows:</p> 452 453<dd> 454</dd> 455 456<dd> </dd> 457<dl class="dl-horizontal"> 458<dt>image</dt> 459<dd>the image. </dd> 460 461<dd> </dd> 462<dt>level</dt> 463<dd>the image gamma as a string (e.g. 1.6,1.2,1.0). </dd> 464 465<dd> </dd> 466<dt>gamma</dt> 467<dd>the image gamma. </dd> 468 469<dd> </dd> 470</dl> 471<h2><a href="../../api/MagickCore/enhance_8c.html" id="GrayscaleImage">GrayscaleImage</a></h2> 472 473<p>GrayscaleImage() converts the image to grayscale.</p> 474 475<p>The format of the GrayscaleImage method is:</p> 476 477<pre class="text"> 478MagickBooleanType GrayscaleImage(Image *image, 479 const PixelIntensityMethod method ,ExceptionInfo *exception) 480</pre> 481 482<p>A description of each parameter follows:</p> 483 484<dd> 485</dd> 486 487<dd> </dd> 488<dl class="dl-horizontal"> 489<dt>image</dt> 490<dd>the image. </dd> 491 492<dd> </dd> 493<dt>method</dt> 494<dd>the pixel intensity method. </dd> 495 496<dd> </dd> 497<dt>exception</dt> 498<dd>return any errors or warnings in this structure. </dd> 499 500<dd> </dd> 501</dl> 502<h2><a href="../../api/MagickCore/enhance_8c.html" id="HaldClutImage">HaldClutImage</a></h2> 503 504<p>HaldClutImage() applies a Hald color lookup table to the image. A Hald color lookup table is a 3-dimensional color cube mapped to 2 dimensions. Create it with the HALD coder. You can apply any color transformation to the Hald image and then use this method to apply the transform to the image.</p> 505 506<p>The format of the HaldClutImage method is:</p> 507 508<pre class="text"> 509MagickBooleanType HaldClutImage(Image *image,Image *hald_image, 510 ExceptionInfo *exception) 511</pre> 512 513<p>A description of each parameter follows:</p> 514 515<dd> 516</dd> 517 518<dd> </dd> 519<dl class="dl-horizontal"> 520<dt>image</dt> 521<dd>the image, which is replaced by indexed CLUT values </dd> 522 523<dd> </dd> 524<dt>hald_image</dt> 525<dd>the color lookup table image for replacement color values. </dd> 526 527<dd> </dd> 528<dt>exception</dt> 529<dd>return any errors or warnings in this structure. </dd> 530 531<dd> </dd> 532</dl> 533<h2><a href="../../api/MagickCore/enhance_8c.html" id="LevelImage">LevelImage</a></h2> 534 535<p>LevelImage() adjusts the levels of a particular image channel by scaling the colors falling between specified white and black points to the full available quantum range.</p> 536 537<p>The parameters provided represent the black, and white points. The black point specifies the darkest color in the image. Colors darker than the black point are set to zero. White point specifies the lightest color in the image. Colors brighter than the white point are set to the maximum quantum value.</p> 538 539<p>If a '!' flag is given, map black and white colors to the given levels rather than mapping those levels to black and white. See LevelizeImage() below.</p> 540 541<p>Gamma specifies a gamma correction to apply to the image.</p> 542 543<p>The format of the LevelImage method is:</p> 544 545<pre class="text"> 546MagickBooleanType LevelImage(Image *image,const double black_point, 547 const double white_point,const double gamma,ExceptionInfo *exception) 548</pre> 549 550<p>A description of each parameter follows:</p> 551 552<dd> 553</dd> 554 555<dd> </dd> 556<dl class="dl-horizontal"> 557<dt>image</dt> 558<dd>the image. </dd> 559 560<dd> </dd> 561<dt>black_point</dt> 562<dd>The level to map zero (black) to. </dd> 563 564<dd> </dd> 565<dt>white_point</dt> 566<dd>The level to map QuantumRange (white) to. </dd> 567 568<dd> </dd> 569<dt>exception</dt> 570<dd>return any errors or warnings in this structure. </dd> 571 572<dd> </dd> 573</dl> 574<h2><a href="../../api/MagickCore/enhance_8c.html" id="LevelizeImage">LevelizeImage</a></h2> 575 576<p>LevelizeImage() applies the reversed LevelImage() operation to just the specific channels specified. It compresses the full range of color values, so that they lie between the given black and white points. Gamma is applied before the values are mapped.</p> 577 578<p>LevelizeImage() can be called with by using a +level command line API option, or using a '!' on a -level or LevelImage() geometry string.</p> 579 580<p>It can be used to de-contrast a greyscale image to the exact levels specified. Or by using specific levels for each channel of an image you can convert a gray-scale image to any linear color gradient, according to those levels.</p> 581 582<p>The format of the LevelizeImage method is:</p> 583 584<pre class="text"> 585MagickBooleanType LevelizeImage(Image *image,const double black_point, 586 const double white_point,const double gamma,ExceptionInfo *exception) 587</pre> 588 589<p>A description of each parameter follows:</p> 590 591<dd> 592</dd> 593 594<dd> </dd> 595<dl class="dl-horizontal"> 596<dt>image</dt> 597<dd>the image. </dd> 598 599<dd> </dd> 600<dt>black_point</dt> 601<dd>The level to map zero (black) to. </dd> 602 603<dd> </dd> 604<dt>white_point</dt> 605<dd>The level to map QuantumRange (white) to. </dd> 606 607<dd> </dd> 608<dt>gamma</dt> 609<dd>adjust gamma by this factor before mapping values. </dd> 610 611<dd> </dd> 612<dt>exception</dt> 613<dd>return any errors or warnings in this structure. </dd> 614 615<dd> </dd> 616</dl> 617<h2><a href="../../api/MagickCore/enhance_8c.html" id="LevelImageColors">LevelImageColors</a></h2> 618 619<p>LevelImageColors() maps the given color to "black" and "white" values, linearly spreading out the colors, and level values on a channel by channel bases, as per LevelImage(). The given colors allows you to specify different level ranges for each of the color channels separately.</p> 620 621<p>If the boolean 'invert' is set true the image values will modifyed in the reverse direction. That is any existing "black" and "white" colors in the image will become the color values given, with all other values compressed appropriately. This effectivally maps a greyscale gradient into the given color gradient.</p> 622 623<p>The format of the LevelImageColors method is:</p> 624 625<pre class="text"> 626 MagickBooleanType LevelImageColors(Image *image, 627const PixelInfo *black_color,const PixelInfo *white_color, 628const MagickBooleanType invert,ExceptionInfo *exception) 629</pre> 630 631<p>A description of each parameter follows:</p> 632 633<dd> 634</dd> 635 636<dd> </dd> 637<dl class="dl-horizontal"> 638<dt>image</dt> 639<dd>the image. </dd> 640 641<dd> </dd> 642<dt>black_color</dt> 643<dd>The color to map black to/from </dd> 644 645<dd> </dd> 646<dt>white_point</dt> 647<dd>The color to map white to/from </dd> 648 649<dd> </dd> 650<dt>invert</dt> 651<dd>if true map the colors (levelize), rather than from (level) </dd> 652 653<dd> </dd> 654<dt>exception</dt> 655<dd>return any errors or warnings in this structure. </dd> 656 657<dd> </dd> 658</dl> 659<h2><a href="../../api/MagickCore/enhance_8c.html" id="LinearStretchImage">LinearStretchImage</a></h2> 660 661<p>LinearStretchImage() discards any pixels below the black point and above the white point and levels the remaining pixels.</p> 662 663<p>The format of the LinearStretchImage method is:</p> 664 665<pre class="text"> 666MagickBooleanType LinearStretchImage(Image *image, 667 const double black_point,const double white_point, 668 ExceptionInfo *exception) 669</pre> 670 671<p>A description of each parameter follows:</p> 672 673<dd> 674</dd> 675 676<dd> </dd> 677<dl class="dl-horizontal"> 678<dt>image</dt> 679<dd>the image. </dd> 680 681<dd> </dd> 682<dt>black_point</dt> 683<dd>the black point. </dd> 684 685<dd> </dd> 686<dt>white_point</dt> 687<dd>the white point. </dd> 688 689<dd> </dd> 690<dt>exception</dt> 691<dd>return any errors or warnings in this structure. </dd> 692 693<dd> </dd> 694</dl> 695<h2><a href="../../api/MagickCore/enhance_8c.html" id="ModulateImage">ModulateImage</a></h2> 696 697<p>ModulateImage() lets you control the brightness, saturation, and hue of an image. Modulate represents the brightness, saturation, and hue as one parameter (e.g. 90,150,100). If the image colorspace is HSL, the modulation is lightness, saturation, and hue. For HWB, use blackness, whiteness, and hue. And for HCL, use chrome, luma, and hue.</p> 698 699<p>The format of the ModulateImage method is:</p> 700 701<pre class="text"> 702MagickBooleanType ModulateImage(Image *image,const char *modulate, 703 ExceptionInfo *exception) 704</pre> 705 706<p>A description of each parameter follows:</p> 707 708<dd> 709</dd> 710 711<dd> </dd> 712<dl class="dl-horizontal"> 713<dt>image</dt> 714<dd>the image. </dd> 715 716<dd> </dd> 717<dt>modulate</dt> 718<dd>Define the percent change in brightness, saturation, and hue. </dd> 719 720<dd> </dd> 721<dt>exception</dt> 722<dd>return any errors or warnings in this structure. </dd> 723 724<dd> </dd> 725</dl> 726<h2><a href="../../api/MagickCore/enhance_8c.html" id="NegateImage">NegateImage</a></h2> 727 728<p>NegateImage() negates the colors in the reference image. The grayscale option means that only grayscale values within the image are negated.</p> 729 730<p>The format of the NegateImage method is:</p> 731 732<pre class="text"> 733MagickBooleanType NegateImage(Image *image, 734 const MagickBooleanType grayscale,ExceptionInfo *exception) 735</pre> 736 737<p>A description of each parameter follows:</p> 738 739<dd> 740</dd> 741 742<dd> </dd> 743<dl class="dl-horizontal"> 744<dt>image</dt> 745<dd>the image. </dd> 746 747<dd> </dd> 748<dt>grayscale</dt> 749<dd>If MagickTrue, only negate grayscale pixels within the image. </dd> 750 751<dd> </dd> 752<dt>exception</dt> 753<dd>return any errors or warnings in this structure. </dd> 754 755<dd> </dd> 756</dl> 757<h2><a href="../../api/MagickCore/enhance_8c.html" id="The_NormalizeImage">The NormalizeImage</a></h2> 758 759<p>The NormalizeImage() method enhances the contrast of a color image by mapping the darkest 2 percent of all pixel to black and the brightest 1 percent to white.</p> 760 761<p>The format of the NormalizeImage method is:</p> 762 763<pre class="text"> 764MagickBooleanType NormalizeImage(Image *image,ExceptionInfo *exception) 765</pre> 766 767<p>A description of each parameter follows:</p> 768 769<dd> 770</dd> 771 772<dd> </dd> 773<dl class="dl-horizontal"> 774<dt>image</dt> 775<dd>the image. </dd> 776 777<dd> </dd> 778<dt>exception</dt> 779<dd>return any errors or warnings in this structure. </dd> 780 781<dd> </dd> 782</dl> 783<h2><a href="../../api/MagickCore/enhance_8c.html" id="SigmoidalContrastImage">SigmoidalContrastImage</a></h2> 784 785<p>SigmoidalContrastImage() adjusts the contrast of an image with a non-linear sigmoidal contrast algorithm. Increase the contrast of the image using a sigmoidal transfer function without saturating highlights or shadows. Contrast indicates how much to increase the contrast (0 is none; 3 is typical; 20 is pushing it); mid-point indicates where midtones fall in the resultant image (0 is white; 50 is middle-gray; 100 is black). Set sharpen to MagickTrue to increase the image contrast otherwise the contrast is reduced.</p> 786 787<p>The format of the SigmoidalContrastImage method is:</p> 788 789<pre class="text"> 790MagickBooleanType SigmoidalContrastImage(Image *image, 791 const MagickBooleanType sharpen,const char *levels, 792 ExceptionInfo *exception) 793</pre> 794 795<p>A description of each parameter follows:</p> 796 797<dd> 798</dd> 799 800<dd> </dd> 801<dl class="dl-horizontal"> 802<dt>image</dt> 803<dd>the image. </dd> 804 805<dd> </dd> 806<dt>sharpen</dt> 807<dd>Increase or decrease image contrast. </dd> 808 809<dd> </dd> 810<dt>contrast</dt> 811<dd>strength of the contrast, the larger the number the more 'threshold-like' it becomes. </dd> 812 813<dd> </dd> 814<dt>midpoint</dt> 815<dd>midpoint of the function as a color value 0 to QuantumRange. </dd> 816 817<dd> </dd> 818<dt>exception</dt> 819<dd>return any errors or warnings in this structure. </dd> 820 821<dd> </dd> 822</dl> 823<h2><a href="../../api/MagickCore/enhance_8c.html" id="WhiteBalanceImage">WhiteBalanceImage</a></h2> 824 825<p>WhiteBalanceImage() applies white balancing to an image according to a grayworld assumption in the LAB colorspace.</p> 826 827<p>The format of the WhiteBalanceImage method is:</p> 828 829<pre class="text"> 830MagickBooleanType WhiteBalanceImage(Image *image, 831 ExceptionInfo *exception) 832</pre> 833 834<p>A description of each parameter follows:</p> 835 836<dd> 837</dd> 838 839<dd> </dd> 840<dl class="dl-horizontal"> 841<dt>image</dt> 842<dd>The image to auto-level </dd> 843 844<dd> </dd> 845<dt>exception</dt> 846<dd>return any errors or warnings in this structure. </dd> 847 848<dd> </dd> 849</dl> 850</div> 851 </div> 852 </main><!-- /.container --> 853 <footer class="magick-footer"> 854 <div class="container-fluid"> 855 <a href="../../www/security-policy.html">Security</a> • 856 <a href="../../www/news.html">News</a> 857 858 <a href="enhance.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../../../images/wand.ico"/></a> 859 860 <a href="../../www/links.html">Related</a> • 861 <a href="../../www/sitemap.html">Sitemap</a> 862 <br/> 863 <a href="../../www/support.html">Sponsor</a> • 864 <a href="../../www/cite.html">Cite</a> • 865 <a href="http://pgp.mit.edu/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> • 866 <a href="../../www/contact.html">Contact Us</a> 867 <br/> 868 <a href="https://github.com/imagemagick/imagemagick" target="_blank" rel="noopener" aria-label="GitHub"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 499.36" width="2%" height="2%" role="img" focusable="false"><title>GitHub</title><path fill="currentColor" fill-rule="evenodd" d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z"/></svg></a> • 869 <a href="https://twitter.com/imagemagick" target="_blank" rel="noopener" aria-label="Twitter"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 416.32" width="2%" height="2%" role="img" focusable="false"><title>Twitter</title><path fill="currentColor" d="M160.83 416.32c193.2 0 298.92-160.22 298.92-298.92 0-4.51 0-9-.2-13.52A214 214 0 0 0 512 49.38a212.93 212.93 0 0 1-60.44 16.6 105.7 105.7 0 0 0 46.3-58.19 209 209 0 0 1-66.79 25.37 105.09 105.09 0 0 0-181.73 71.91 116.12 116.12 0 0 0 2.66 24c-87.28-4.3-164.73-46.3-216.56-109.82A105.48 105.48 0 0 0 68 159.6a106.27 106.27 0 0 1-47.53-13.11v1.43a105.28 105.28 0 0 0 84.21 103.06 105.67 105.67 0 0 1-47.33 1.84 105.06 105.06 0 0 0 98.14 72.94A210.72 210.72 0 0 1 25 370.84a202.17 202.17 0 0 1-25-1.43 298.85 298.85 0 0 0 160.83 46.92"/></svg></a> 870 <br/> 871 <small>© 1999-2021 ImageMagick Studio LLC</small> 872 </div> 873 </footer> 874 875 <!-- Javascript assets --> 876 <script src="../../assets/magick.js" ></script> 877 </body> 878</html> 879