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,minimum-scale=1,initial-scale=1,shrink-to-fit=no" /> 10 <title>MagickCore, C API: Enhance an Image @ ImageMagick</title> 11 <meta name="application-name" content="ImageMagick" /> 12 <meta name="description" content="Use ImageMagick to create, edit, compose, or convert bitmap images. You can resize your image, crop it, change its shades and colors, add captions, among other operations." /> 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, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert" /> 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-2017 ImageMagick Studio LLC" /> 23 <meta name="distribution" content="Global" /> 24 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" /> 25 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> 26 <link href="enhance.html" rel="canonical" /> 27 <link href="../../images/wand.png" rel="icon" /> 28 <link href="../../images/wand.ico" rel="shortcut icon" /> 29 <link href="../assets/magick.css" rel="stylesheet" /> 30 </head> 31 <body> 32 <header> 33 <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> 34 <a class="navbar-brand" href="../../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../../images/wand.ico"/></a> 35 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation"> 36 <span class="navbar-toggler-icon"></span> 37 </button> 38 39 <div class="navbar-collapse collapse" id="navbarsMagick" style=""> 40 <ul class="navbar-nav mr-auto"> 41 <li class="nav-item "> 42 <a class="nav-link" href="quantize.html">Home <span class="sr-only">(current)</span></a> 43 </li> 44 <li class="nav-item "> 45 <a class="nav-link" href="../../www/download.html">Download</a> 46 </li> 47 <li class="nav-item "> 48 <a class="nav-link" href="../../www/command-line-tools.html">Tools</a> 49 </li> 50 <li class="nav-item "> 51 <a class="nav-link" href="../../www/command-line-processing.html">Command-line</a> 52 </li> 53 <li class="nav-item "> 54 <a class="nav-link" href="../../www/resources.html">Resources</a> 55 </li> 56 <li class="nav-item "> 57 <a class="nav-link" href="../../www/develop.html">Develop</a> 58 </li> 59 <li class="nav-item"> 60 <a class="nav-link" target="_blank" href="https://imagemagick.org/discourse-server/">Community</a> 61 </li> 62 </ul> 63 <form class="form-inline my-2 my-lg-0" action="https://imagemagick.org/script/search.php"> 64 <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search"> 65 <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button> 66 </form> 67 </div> 68 </nav> 69 <div class="container"> 70 <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" 71 style="display:block" 72 data-ad-client="ca-pub-3129977114552745" 73 data-ad-slot="6345125851" 74 data-ad-format="auto"></ins> 75 <script> 76 (adsbygoogle = window.adsbygoogle || []).push({}); 77 </script> 78 79 </div> 80 </header> 81 <main class="container"> 82 <div class="magick-template"> 83 <div class="magick-header"> 84 <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></p> 85 86 <h2><a href="../../api/MagickCore/enhance_8c.html" id="AutoGammaImage">AutoGammaImage</a></h2> 87 88 <p>AutoGammaImage() extract the 'mean' from the image and adjust the image to try make set its gamma appropriatally.</p> 89 90 <p>The format of the AutoGammaImage method is:</p> 91 92 <pre class="text"> 93 MagickBooleanType AutoGammaImage(Image *image,ExceptionInfo *exception) 94 </pre> 95 96 <p>A description of each parameter follows:</p> 97 98 <dd> 99 </dd> 100 101 <dd> </dd> 102 <dl class="dl-horizontal"> 103 <dt>image</dt> 104 <dd>The image to auto-level </dd> 105 106 <dd> </dd> 107 <dt>exception</dt> 108 <dd>return any errors or warnings in this structure. </dd> 109 110 <dd> </dd> 111 </dl> 112 <h2><a href="../../api/MagickCore/enhance_8c.html" id="AutoLevelImage">AutoLevelImage</a></h2> 113 114 <p>AutoLevelImage() adjusts the levels of a particular image channel by scaling the minimum and maximum values to the full quantum range.</p> 115 116 <p>The format of the LevelImage method is:</p> 117 118 <pre class="text"> 119 MagickBooleanType AutoLevelImage(Image *image,ExceptionInfo *exception) 120 </pre> 121 122 <p>A description of each parameter follows:</p> 123 124 <dd> 125 </dd> 126 127 <dd> </dd> 128 <dl class="dl-horizontal"> 129 <dt>image</dt> 130 <dd>The image to auto-level </dd> 131 132 <dd> </dd> 133 <dt>exception</dt> 134 <dd>return any errors or warnings in this structure. </dd> 135 136 <dd> </dd> 137 </dl> 138 <h2><a href="../../api/MagickCore/enhance_8c.html" id="BrightnessContrastImage">BrightnessContrastImage</a></h2> 139 140 <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> 141 142 <p>The format of the BrightnessContrastImage method is:</p> 143 144 <pre class="text"> 145 MagickBooleanType BrightnessContrastImage(Image *image, 146 const double brightness,const double contrast,ExceptionInfo *exception) 147 </pre> 148 149 <p>A description of each parameter follows:</p> 150 151 <dd> 152 </dd> 153 154 <dd> </dd> 155 <dl class="dl-horizontal"> 156 <dt>image</dt> 157 <dd>the image. </dd> 158 159 <dd> </dd> 160 <dt>brightness</dt> 161 <dd>the brightness percent (-100 .. 100). </dd> 162 163 <dd> </dd> 164 <dt>contrast</dt> 165 <dd>the contrast percent (-100 .. 100). </dd> 166 167 <dd> </dd> 168 <dt>exception</dt> 169 <dd>return any errors or warnings in this structure. </dd> 170 171 <dd> </dd> 172 </dl> 173 <h2><a href="../../api/MagickCore/enhance_8c.html" id="CLAHEImage">CLAHEImage</a></h2> 174 175 <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> 176 177 <p>Adapted from implementation by Karel Zuiderveld, karel (a] cv.ruu.nl in "Graphics Gems IV", Academic Press, 1994.</p> 178 179 <p>The format of the CLAHEImage method is:</p> 180 181 <pre class="text"> 182 MagickBooleanType CLAHEImage(Image *image,const size_t width, 183 const size_t height,const size_t number_bins,const double clip_limit, 184 ExceptionInfo *exception) 185 </pre> 186 187 <p>A description of each parameter follows:</p> 188 189 <dd> 190 </dd> 191 192 <dd> </dd> 193 <dl class="dl-horizontal"> 194 <dt>image</dt> 195 <dd>the image. </dd> 196 197 <dd> </dd> 198 <dt>width</dt> 199 <dd>the width of the tile divisions to use in horizontal direction. </dd> 200 201 <dd> </dd> 202 <dt>height</dt> 203 <dd>the height of the tile divisions to use in vertical direction. </dd> 204 205 <dd> </dd> 206 <dt>number_bins</dt> 207 <dd>number of bins for histogram ("dynamic range"). </dd> 208 209 <dd> </dd> 210 <dt>clip_limit</dt> 211 <dd>contrast limit for localised changes in contrast. A limit less than 1 results in standard non-contrast limited AHE. </dd> 212 213 <dd> </dd> 214 <dt>exception</dt> 215 <dd>return any errors or warnings in this structure. </dd> 216 217 <dd> </dd> 218 </dl> 219 <h2><a href="../../api/MagickCore/enhance_8c.html" id="ClutImage">ClutImage</a></h2> 220 221 <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> 222 223 <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> 224 225 <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> 226 227 <p>The format of the ClutImage method is:</p> 228 229 <pre class="text"> 230 MagickBooleanType ClutImage(Image *image,Image *clut_image, 231 const PixelInterpolateMethod method,ExceptionInfo *exception) 232 </pre> 233 234 <p>A description of each parameter follows:</p> 235 236 <dd> 237 </dd> 238 239 <dd> </dd> 240 <dl class="dl-horizontal"> 241 <dt>image</dt> 242 <dd>the image, which is replaced by indexed CLUT values </dd> 243 244 <dd> </dd> 245 <dt>clut_image</dt> 246 <dd>the color lookup table image for replacement color values. </dd> 247 248 <dd> </dd> 249 <dt>method</dt> 250 <dd>the pixel interpolation method. </dd> 251 252 <dd> </dd> 253 <dt>exception</dt> 254 <dd>return any errors or warnings in this structure. </dd> 255 256 <dd> </dd> 257 </dl> 258 <h2><a href="../../api/MagickCore/enhance_8c.html" id="ColorDecisionListImage">ColorDecisionListImage</a></h2> 259 260 <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> 261 262 <pre class="text"> 263 <ColorCorrectionCollection xmlns="urn:ASC:CDL:v1.2"> 264 <ColorCorrection id="cc03345"> 265 <SOPNode> 266 <Slope> 0.9 1.2 0.5 </Slope> 267 <Offset> 0.4 -0.5 0.6 </Offset> 268 <Power> 1.0 0.8 1.5 </Power> 269 </SOPNode> 270 <SATNode> 271 <Saturation> 0.85 </Saturation> 272 </SATNode> 273 </ColorCorrection> 274 </ColorCorrectionCollection> 275 </pre> 276 277 <p>which includes the slop, offset, and power for each of the RGB channels as well as the saturation.</p> 278 279 <p>The format of the ColorDecisionListImage method is:</p> 280 281 <pre class="text"> 282 MagickBooleanType ColorDecisionListImage(Image *image, 283 const char *color_correction_collection,ExceptionInfo *exception) 284 </pre> 285 286 <p>A description of each parameter follows:</p> 287 288 <dd> 289 </dd> 290 291 <dd> </dd> 292 <dl class="dl-horizontal"> 293 <dt>image</dt> 294 <dd>the image. </dd> 295 296 <dd> </dd> 297 <dt>color_correction_collection</dt> 298 <dd>the color correction collection in XML. </dd> 299 300 <dd> </dd> 301 <dt>exception</dt> 302 <dd>return any errors or warnings in this structure. </dd> 303 304 <dd> </dd> 305 </dl> 306 <h2><a href="../../api/MagickCore/enhance_8c.html" id="ContrastImage">ContrastImage</a></h2> 307 308 <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> 309 310 <p>The format of the ContrastImage method is:</p> 311 312 <pre class="text"> 313 MagickBooleanType ContrastImage(Image *image, 314 const MagickBooleanType sharpen,ExceptionInfo *exception) 315 </pre> 316 317 <p>A description of each parameter follows:</p> 318 319 <dd> 320 </dd> 321 322 <dd> </dd> 323 <dl class="dl-horizontal"> 324 <dt>image</dt> 325 <dd>the image. </dd> 326 327 <dd> </dd> 328 <dt>sharpen</dt> 329 <dd>Increase or decrease image contrast. </dd> 330 331 <dd> </dd> 332 <dt>exception</dt> 333 <dd>return any errors or warnings in this structure. </dd> 334 335 <dd> </dd> 336 </dl> 337 <h2><a href="../../api/MagickCore/enhance_8c.html" id="ContrastStretchImage">ContrastStretchImage</a></h2> 338 339 <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> 340 341 <p>The format of the ContrastStretchImage method is:</p> 342 343 <pre class="text"> 344 MagickBooleanType ContrastStretchImage(Image *image, 345 const char *levels,ExceptionInfo *exception) 346 </pre> 347 348 <p>A description of each parameter follows:</p> 349 350 <dd> 351 </dd> 352 353 <dd> </dd> 354 <dl class="dl-horizontal"> 355 <dt>image</dt> 356 <dd>the image. </dd> 357 358 <dd> </dd> 359 <dt>black_point</dt> 360 <dd>the black point. </dd> 361 362 <dd> </dd> 363 <dt>white_point</dt> 364 <dd>the white point. </dd> 365 366 <dd> </dd> 367 <dt>levels</dt> 368 <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> 369 370 <dd> </dd> 371 <dt>exception</dt> 372 <dd>return any errors or warnings in this structure. </dd> 373 374 <dd> </dd> 375 </dl> 376 <h2><a href="../../api/MagickCore/enhance_8c.html" id="EnhanceImage">EnhanceImage</a></h2> 377 378 <p>EnhanceImage() applies a digital filter that improves the quality of a noisy image.</p> 379 380 <p>The format of the EnhanceImage method is:</p> 381 382 <pre class="text"> 383 Image *EnhanceImage(const Image *image,ExceptionInfo *exception) 384 </pre> 385 386 <p>A description of each parameter follows:</p> 387 388 <dd> 389 </dd> 390 391 <dd> </dd> 392 <dl class="dl-horizontal"> 393 <dt>image</dt> 394 <dd>the image. </dd> 395 396 <dd> </dd> 397 <dt>exception</dt> 398 <dd>return any errors or warnings in this structure. </dd> 399 400 <dd> </dd> 401 </dl> 402 <h2><a href="../../api/MagickCore/enhance_8c.html" id="EqualizeImage">EqualizeImage</a></h2> 403 404 <p>EqualizeImage() applies a histogram equalization to the image.</p> 405 406 <p>The format of the EqualizeImage method is:</p> 407 408 <pre class="text"> 409 MagickBooleanType EqualizeImage(Image *image,ExceptionInfo *exception) 410 </pre> 411 412 <p>A description of each parameter follows:</p> 413 414 <dd> 415 </dd> 416 417 <dd> </dd> 418 <dl class="dl-horizontal"> 419 <dt>image</dt> 420 <dd>the image. </dd> 421 422 <dd> </dd> 423 <dt>exception</dt> 424 <dd>return any errors or warnings in this structure. </dd> 425 426 <dd> </dd> 427 </dl> 428 <h2><a href="../../api/MagickCore/enhance_8c.html" id="GammaImage">GammaImage</a></h2> 429 430 <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> 431 432 <p>You can also reduce the influence of a particular channel with a gamma value of 0.</p> 433 434 <p>The format of the GammaImage method is:</p> 435 436 <pre class="text"> 437 MagickBooleanType GammaImage(Image *image,const double gamma, 438 ExceptionInfo *exception) 439 </pre> 440 441 <p>A description of each parameter follows:</p> 442 443 <dd> 444 </dd> 445 446 <dd> </dd> 447 <dl class="dl-horizontal"> 448 <dt>image</dt> 449 <dd>the image. </dd> 450 451 <dd> </dd> 452 <dt>level</dt> 453 <dd>the image gamma as a string (e.g. 1.6,1.2,1.0). </dd> 454 455 <dd> </dd> 456 <dt>gamma</dt> 457 <dd>the image gamma. </dd> 458 459 <dd> </dd> 460 </dl> 461 <h2><a href="../../api/MagickCore/enhance_8c.html" id="GrayscaleImage">GrayscaleImage</a></h2> 462 463 <p>GrayscaleImage() converts the image to grayscale.</p> 464 465 <p>The format of the GrayscaleImage method is:</p> 466 467 <pre class="text"> 468 MagickBooleanType GrayscaleImage(Image *image, 469 const PixelIntensityMethod method ,ExceptionInfo *exception) 470 </pre> 471 472 <p>A description of each parameter follows:</p> 473 474 <dd> 475 </dd> 476 477 <dd> </dd> 478 <dl class="dl-horizontal"> 479 <dt>image</dt> 480 <dd>the image. </dd> 481 482 <dd> </dd> 483 <dt>method</dt> 484 <dd>the pixel intensity method. </dd> 485 486 <dd> </dd> 487 <dt>exception</dt> 488 <dd>return any errors or warnings in this structure. </dd> 489 490 <dd> </dd> 491 </dl> 492 <h2><a href="../../api/MagickCore/enhance_8c.html" id="HaldClutImage">HaldClutImage</a></h2> 493 494 <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> 495 496 <p>The format of the HaldClutImage method is:</p> 497 498 <pre class="text"> 499 MagickBooleanType HaldClutImage(Image *image,Image *hald_image, 500 ExceptionInfo *exception) 501 </pre> 502 503 <p>A description of each parameter follows:</p> 504 505 <dd> 506 </dd> 507 508 <dd> </dd> 509 <dl class="dl-horizontal"> 510 <dt>image</dt> 511 <dd>the image, which is replaced by indexed CLUT values </dd> 512 513 <dd> </dd> 514 <dt>hald_image</dt> 515 <dd>the color lookup table image for replacement color values. </dd> 516 517 <dd> </dd> 518 <dt>exception</dt> 519 <dd>return any errors or warnings in this structure. </dd> 520 521 <dd> </dd> 522 </dl> 523 <h2><a href="../../api/MagickCore/enhance_8c.html" id="LevelImage">LevelImage</a></h2> 524 525 <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> 526 527 <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> 528 529 <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> 530 531 <p>Gamma specifies a gamma correction to apply to the image.</p> 532 533 <p>The format of the LevelImage method is:</p> 534 535 <pre class="text"> 536 MagickBooleanType LevelImage(Image *image,const double black_point, 537 const double white_point,const double gamma,ExceptionInfo *exception) 538 </pre> 539 540 <p>A description of each parameter follows:</p> 541 542 <dd> 543 </dd> 544 545 <dd> </dd> 546 <dl class="dl-horizontal"> 547 <dt>image</dt> 548 <dd>the image. </dd> 549 550 <dd> </dd> 551 <dt>black_point</dt> 552 <dd>The level to map zero (black) to. </dd> 553 554 <dd> </dd> 555 <dt>white_point</dt> 556 <dd>The level to map QuantumRange (white) to. </dd> 557 558 <dd> </dd> 559 <dt>exception</dt> 560 <dd>return any errors or warnings in this structure. </dd> 561 562 <dd> </dd> 563 </dl> 564 <h2><a href="../../api/MagickCore/enhance_8c.html" id="LevelizeImage">LevelizeImage</a></h2> 565 566 <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> 567 568 <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> 569 570 <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> 571 572 <p>The format of the LevelizeImage method is:</p> 573 574 <pre class="text"> 575 MagickBooleanType LevelizeImage(Image *image,const double black_point, 576 const double white_point,const double gamma,ExceptionInfo *exception) 577 </pre> 578 579 <p>A description of each parameter follows:</p> 580 581 <dd> 582 </dd> 583 584 <dd> </dd> 585 <dl class="dl-horizontal"> 586 <dt>image</dt> 587 <dd>the image. </dd> 588 589 <dd> </dd> 590 <dt>black_point</dt> 591 <dd>The level to map zero (black) to. </dd> 592 593 <dd> </dd> 594 <dt>white_point</dt> 595 <dd>The level to map QuantumRange (white) to. </dd> 596 597 <dd> </dd> 598 <dt>gamma</dt> 599 <dd>adjust gamma by this factor before mapping values. </dd> 600 601 <dd> </dd> 602 <dt>exception</dt> 603 <dd>return any errors or warnings in this structure. </dd> 604 605 <dd> </dd> 606 </dl> 607 <h2><a href="../../api/MagickCore/enhance_8c.html" id="LevelImageColors">LevelImageColors</a></h2> 608 609 <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> 610 611 <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 appropriatally. This effectivally maps a greyscale gradient into the given color gradient.</p> 612 613 <p>The format of the LevelImageColors method is:</p> 614 615 <pre class="text"> 616 MagickBooleanType LevelImageColors(Image *image, 617 const PixelInfo *black_color,const PixelInfo *white_color, 618 const MagickBooleanType invert,ExceptionInfo *exception) 619 </pre> 620 621 <p>A description of each parameter follows:</p> 622 623 <dd> 624 </dd> 625 626 <dd> </dd> 627 <dl class="dl-horizontal"> 628 <dt>image</dt> 629 <dd>the image. </dd> 630 631 <dd> </dd> 632 <dt>black_color</dt> 633 <dd>The color to map black to/from </dd> 634 635 <dd> </dd> 636 <dt>white_point</dt> 637 <dd>The color to map white to/from </dd> 638 639 <dd> </dd> 640 <dt>invert</dt> 641 <dd>if true map the colors (levelize), rather than from (level) </dd> 642 643 <dd> </dd> 644 <dt>exception</dt> 645 <dd>return any errors or warnings in this structure. </dd> 646 647 <dd> </dd> 648 </dl> 649 <h2><a href="../../api/MagickCore/enhance_8c.html" id="LinearStretchImage">LinearStretchImage</a></h2> 650 651 <p>LinearStretchImage() discards any pixels below the black point and above the white point and levels the remaining pixels.</p> 652 653 <p>The format of the LinearStretchImage method is:</p> 654 655 <pre class="text"> 656 MagickBooleanType LinearStretchImage(Image *image, 657 const double black_point,const double white_point, 658 ExceptionInfo *exception) 659 </pre> 660 661 <p>A description of each parameter follows:</p> 662 663 <dd> 664 </dd> 665 666 <dd> </dd> 667 <dl class="dl-horizontal"> 668 <dt>image</dt> 669 <dd>the image. </dd> 670 671 <dd> </dd> 672 <dt>black_point</dt> 673 <dd>the black point. </dd> 674 675 <dd> </dd> 676 <dt>white_point</dt> 677 <dd>the white point. </dd> 678 679 <dd> </dd> 680 <dt>exception</dt> 681 <dd>return any errors or warnings in this structure. </dd> 682 683 <dd> </dd> 684 </dl> 685 <h2><a href="../../api/MagickCore/enhance_8c.html" id="ModulateImage">ModulateImage</a></h2> 686 687 <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> 688 689 <p>The format of the ModulateImage method is:</p> 690 691 <pre class="text"> 692 MagickBooleanType ModulateImage(Image *image,const char *modulate, 693 ExceptionInfo *exception) 694 </pre> 695 696 <p>A description of each parameter follows:</p> 697 698 <dd> 699 </dd> 700 701 <dd> </dd> 702 <dl class="dl-horizontal"> 703 <dt>image</dt> 704 <dd>the image. </dd> 705 706 <dd> </dd> 707 <dt>modulate</dt> 708 <dd>Define the percent change in brightness, saturation, and hue. </dd> 709 710 <dd> </dd> 711 <dt>exception</dt> 712 <dd>return any errors or warnings in this structure. </dd> 713 714 <dd> </dd> 715 </dl> 716 <h2><a href="../../api/MagickCore/enhance_8c.html" id="NegateImage">NegateImage</a></h2> 717 718 <p>NegateImage() negates the colors in the reference image. The grayscale option means that only grayscale values within the image are negated.</p> 719 720 <p>The format of the NegateImage method is:</p> 721 722 <pre class="text"> 723 MagickBooleanType NegateImage(Image *image, 724 const MagickBooleanType grayscale,ExceptionInfo *exception) 725 </pre> 726 727 <p>A description of each parameter follows:</p> 728 729 <dd> 730 </dd> 731 732 <dd> </dd> 733 <dl class="dl-horizontal"> 734 <dt>image</dt> 735 <dd>the image. </dd> 736 737 <dd> </dd> 738 <dt>grayscale</dt> 739 <dd>If MagickTrue, only negate grayscale pixels within the image. </dd> 740 741 <dd> </dd> 742 <dt>exception</dt> 743 <dd>return any errors or warnings in this structure. </dd> 744 745 <dd> </dd> 746 </dl> 747 <h2><a href="../../api/MagickCore/enhance_8c.html" id="The_NormalizeImage">The NormalizeImage</a></h2> 748 749 <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> 750 751 <p>The format of the NormalizeImage method is:</p> 752 753 <pre class="text"> 754 MagickBooleanType NormalizeImage(Image *image,ExceptionInfo *exception) 755 </pre> 756 757 <p>A description of each parameter follows:</p> 758 759 <dd> 760 </dd> 761 762 <dd> </dd> 763 <dl class="dl-horizontal"> 764 <dt>image</dt> 765 <dd>the image. </dd> 766 767 <dd> </dd> 768 <dt>exception</dt> 769 <dd>return any errors or warnings in this structure. </dd> 770 771 <dd> </dd> 772 </dl> 773 <h2><a href="../../api/MagickCore/enhance_8c.html" id="SigmoidalContrastImage">SigmoidalContrastImage</a></h2> 774 775 <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> 776 777 <p>The format of the SigmoidalContrastImage method is:</p> 778 779 <pre class="text"> 780 MagickBooleanType SigmoidalContrastImage(Image *image, 781 const MagickBooleanType sharpen,const char *levels, 782 ExceptionInfo *exception) 783 </pre> 784 785 <p>A description of each parameter follows:</p> 786 787 <dd> 788 </dd> 789 790 <dd> </dd> 791 <dl class="dl-horizontal"> 792 <dt>image</dt> 793 <dd>the image. </dd> 794 795 <dd> </dd> 796 <dt>sharpen</dt> 797 <dd>Increase or decrease image contrast. </dd> 798 799 <dd> </dd> 800 <dt>contrast</dt> 801 <dd>strength of the contrast, the larger the number the more 'threshold-like' it becomes. </dd> 802 803 <dd> </dd> 804 <dt>midpoint</dt> 805 <dd>midpoint of the function as a color value 0 to QuantumRange. </dd> 806 807 <dd> </dd> 808 <dt>exception</dt> 809 <dd>return any errors or warnings in this structure. </dd> 810 811 <dd> </dd> 812 </dl> 813 </div> 814 </div> 815 </main><!-- /.container --> 816 <footer class="magick-footer"> 817 <p><a href="../../www/security-policy.html">Security</a> 818 <a href="../../www/architecture.html">Architecture</a> 819 <a href="../../www/links.html">Related</a> 820 <a href="../../www/sitemap.html">Sitemap</a> 821 822 <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> 823 824 <a href="http://pgp.mit.edu/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> 825 <a href="../../www/support.html">Donate</a> 826 <a href="../../www/contact.html">Contact Us</a> 827 <br/> 828 <small> 1999-2019 ImageMagick Studio LLC</small></p> 829 </footer> 830 831 <!-- Javascript assets --> 832 <script src="../assets/magick.js" crossorigin="anonymous"></script> 833 <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.3.1/jquery.min.js"><\/script>')</script> 834 </body> 835 </html> 836 <!-- Magick Cache 30th December 2018 13:22 -->