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>ImageMagick - MagickCore, C API: Set Text Attributes</title> 11 <meta name="application-name" content="ImageMagick" /> 12 <meta name="description" content="Use ImageMagick® to create, edit, compose, and convert bitmap 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:, set, text, attributes, 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-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="Convert, Edit, or Compose Bitmap Images" /> 31 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" /> 32 <link href="../www/api/attribute.html" rel="canonical" /> 33 <link href="../../www/images/wand.png" rel="icon" /> 34 <link href="../../www/images/wand.ico" rel="shortcut icon" /> 35 <link href="../../www/assets/magick.css" rel="stylesheet" /> 36</head> 37<body> 38 <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> 39 <a class="navbar-brand" href="../../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../../www/images/wand.ico"/></a> 40 <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsMagick" aria-controls="navbarsMagick" aria-expanded="false" aria-label="Toggle navigation"> 41 <span class="navbar-toggler-icon"></span> 42 </button> 43 44 <div class="navbar-collapse collapse" id="navbarsMagick" style=""> 45 <ul class="navbar-nav mr-auto"> 46 <li class="nav-item "> 47 <a class="nav-link" href="../../www/">Home <span class="sr-only">(current)</span></a> 48 </li> 49 <li class="nav-item "> 50 <a class="nav-link" href="../../www/www/download.html">Download</a> 51 </li> 52 <li class="nav-item "> 53 <a class="nav-link" href="../../www/www/command-line-tools.html">Tools</a> 54 </li> 55 <li class="nav-item "> 56 <a class="nav-link" href="../../www/www/command-line-processing.html">Command-line</a> 57 </li> 58 <li class="nav-item "> 59 <a class="nav-link" href="../../www/www/resources.html">Resources</a> 60 </li> 61 <li class="nav-item "> 62 <a class="nav-link" href="../../www/www/develop.html">Develop</a> 63 </li> 64 <li class="nav-item"> 65 <a class="nav-link" target="_blank" href="https://imagemagick.org/discourse-server/">Community</a> 66 </li> 67 </ul> 68 <form class="form-inline my-2 my-lg-0" action="../../www/www/search.html"> 69 <input class="form-control mr-sm-2" type="text" name="q" placeholder="Search" aria-label="Search"> 70 <button class="btn btn-outline-success my-2 my-sm-0" type="submit" name="sa">Search</button> 71 </form> 72 </div> 73 </nav> 74 <div class="container"> 75 <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" 76 style="display:block" 77 data-ad-client="ca-pub-3129977114552745" 78 data-ad-slot="6345125851" 79 data-full-width-responsive="true" 80 data-ad-format="horizontal"></ins> 81 <script> 82 (adsbygoogle = window.adsbygoogle || []).push({}); 83 </script> 84 85 </div> 86 87 <main class="container"> 88 <div class="magick-template"> 89<div class="magick-header"> 90<p class="text-center"><a href="attribute.html#GetImageDepth">GetImageDepth</a> • <a href="attribute.html#GetImageQuantumDepth">GetImageQuantumDepth</a> • <a href="attribute.html#GetImageType">GetImageType</a> • <a href="attribute.html#IdentifyImageGray">IdentifyImageGray</a> • <a href="attribute.html#IdentifyImageMonochrome">IdentifyImageMonochrome</a> • <a href="attribute.html#IdentifyImageType">IdentifyImageType</a> • <a href="attribute.html#IsImageGray">IsImageGray</a> • <a href="attribute.html#IsImageMonochrome">IsImageMonochrome</a> • <a href="attribute.html#IsImageOpaque">IsImageOpaque</a> • <a href="attribute.html#SetImageDepth">SetImageDepth</a> • <a href="attribute.html#SetImageType">SetImageType</a></p> 91 92<h2><a href="../../api/MagickCore/attribute_8c.html" id="GetImageDepth">GetImageDepth</a></h2> 93 94<p>GetImageDepth() returns the depth of a particular image channel.</p> 95 96<p>The format of the GetImageDepth method is:</p> 97 98<pre class="text"> 99size_t GetImageDepth(const Image *image,ExceptionInfo *exception) 100</pre> 101 102<p>A description of each parameter follows:</p> 103 104<dd> 105</dd> 106 107<dd> </dd> 108<dl class="dl-horizontal"> 109<dt>image</dt> 110<dd>the image. </dd> 111 112<dd> </dd> 113<dt>exception</dt> 114<dd>return any errors or warnings in this structure. </dd> 115 116<dd> </dd> 117</dl> 118<h2><a href="../../api/MagickCore/attribute_8c.html" id="GetImageQuantumDepth">GetImageQuantumDepth</a></h2> 119 120<p>GetImageQuantumDepth() returns the depth of the image rounded to a legal quantum depth: 8, 16, or 32.</p> 121 122<p>The format of the GetImageQuantumDepth method is:</p> 123 124<pre class="text"> 125size_t GetImageQuantumDepth(const Image *image, 126 const MagickBooleanType constrain) 127</pre> 128 129<p>A description of each parameter follows:</p> 130 131<dd> 132</dd> 133 134<dd> </dd> 135<dl class="dl-horizontal"> 136<dt>image</dt> 137<dd>the image. </dd> 138 139<dd> </dd> 140<dt>constrain</dt> 141<dd>A value other than MagickFalse, constrains the depth to a maximum of MAGICKCORE_QUANTUM_DEPTH. </dd> 142 143<dd> </dd> 144</dl> 145<h2><a href="../../api/MagickCore/attribute_8c.html" id="GetImageType">GetImageType</a></h2> 146 147<p>GetImageType() returns the type of image:</p> 148 149<p>Bilevel Grayscale GrayscaleMatte Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationMatte</p> 150 151<p>The format of the GetImageType method is:</p> 152 153<pre class="text"> 154ImageType GetImageType(const Image *image) 155</pre> 156 157<p>A description of each parameter follows:</p> 158 159<dd> 160</dd> 161 162<dd> </dd> 163<dl class="dl-horizontal"> 164<dt>image</dt> 165<dd>the image. </dd> 166 167<dd> </dd> 168</dl> 169<h2><a href="../../api/MagickCore/attribute_8c.html" id="IdentifyImageGray">IdentifyImageGray</a></h2> 170 171<p>IdentifyImageGray() returns grayscale if all the pixels in the image have the same red, green, and blue intensities, and bi-level is the intensity is either 0 or QuantumRange. Otherwise undefined is returned.</p> 172 173<p>The format of the IdentifyImageGray method is:</p> 174 175<pre class="text"> 176ImageType IdentifyImageGray(const Image *image,ExceptionInfo *exception) 177</pre> 178 179<p>A description of each parameter follows:</p> 180 181<dd> 182</dd> 183 184<dd> </dd> 185<dl class="dl-horizontal"> 186<dt>image</dt> 187<dd>the image. </dd> 188 189<dd> </dd> 190<dt>exception</dt> 191<dd>return any errors or warnings in this structure. </dd> 192 193<dd> </dd> 194</dl> 195<h2><a href="../../api/MagickCore/attribute_8c.html" id="IdentifyImageMonochrome">IdentifyImageMonochrome</a></h2> 196 197<p>IdentifyImageMonochrome() returns MagickTrue if all the pixels in the image have the same red, green, and blue intensities and the intensity is either 0 or QuantumRange.</p> 198 199<p>The format of the IdentifyImageMonochrome method is:</p> 200 201<pre class="text"> 202MagickBooleanType IdentifyImageMonochrome(const Image *image, 203 ExceptionInfo *exception) 204</pre> 205 206<p>A description of each parameter follows:</p> 207 208<dd> 209</dd> 210 211<dd> </dd> 212<dl class="dl-horizontal"> 213<dt>image</dt> 214<dd>the image. </dd> 215 216<dd> </dd> 217<dt>exception</dt> 218<dd>return any errors or warnings in this structure. </dd> 219 220<dd> </dd> 221</dl> 222<h2><a href="../../api/MagickCore/attribute_8c.html" id="IdentifyImageType">IdentifyImageType</a></h2> 223 224<p>IdentifyImageType() returns the potential type of image:</p> 225 226<p>Bilevel Grayscale GrayscaleMatte Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationMatte</p> 227 228<p>To ensure the image type matches its potential, use SetImageType():</p> 229 230<pre class="text"> 231 (void) SetImageType(image,IdentifyImageType(image,exception),exception); 232</pre> 233 234<p>The format of the IdentifyImageType method is:</p> 235 236<pre class="text"> 237ImageType IdentifyImageType(const Image *image,ExceptionInfo *exception) 238</pre> 239 240<p>A description of each parameter follows:</p> 241 242<dd> 243</dd> 244 245<dd> </dd> 246<dl class="dl-horizontal"> 247<dt>image</dt> 248<dd>the image. </dd> 249 250<dd> </dd> 251<dt>exception</dt> 252<dd>return any errors or warnings in this structure. </dd> 253 254<dd> </dd> 255</dl> 256<h2><a href="../../api/MagickCore/attribute_8c.html" id="IsImageGray">IsImageGray</a></h2> 257 258<p>IsImageGray() returns MagickTrue if the type of the image is grayscale or bi-level.</p> 259 260<p>The format of the IsImageGray method is:</p> 261 262<pre class="text"> 263MagickBooleanType IsImageGray(const Image *image) 264</pre> 265 266<p>A description of each parameter follows:</p> 267 268<dd> 269</dd> 270 271<dd> </dd> 272<dl class="dl-horizontal"> 273<dt>image</dt> 274<dd>the image. </dd> 275 276<dd> </dd> 277</dl> 278<h2><a href="../../api/MagickCore/attribute_8c.html" id="IsImageMonochrome">IsImageMonochrome</a></h2> 279 280<p>IsImageMonochrome() returns MagickTrue if type of the image is bi-level.</p> 281 282<p>The format of the IsImageMonochrome method is:</p> 283 284<pre class="text"> 285MagickBooleanType IsImageMonochrome(const Image *image) 286</pre> 287 288<p>A description of each parameter follows:</p> 289 290<dd> 291</dd> 292 293<dd> </dd> 294<dl class="dl-horizontal"> 295<dt>image</dt> 296<dd>the image. </dd> 297 298<dd> </dd> 299</dl> 300<h2><a href="../../api/MagickCore/attribute_8c.html" id="IsImageOpaque">IsImageOpaque</a></h2> 301 302<p>IsImageOpaque() returns MagickTrue if none of the pixels in the image have an alpha value other than OpaqueAlpha (QuantumRange).</p> 303 304<p>Will return true immediatally is alpha channel is not available.</p> 305 306<p>The format of the IsImageOpaque method is:</p> 307 308<pre class="text"> 309MagickBooleanType IsImageOpaque(const Image *image, 310 ExceptionInfo *exception) 311</pre> 312 313<p>A description of each parameter follows:</p> 314 315<dd> 316</dd> 317 318<dd> </dd> 319<dl class="dl-horizontal"> 320<dt>image</dt> 321<dd>the image. </dd> 322 323<dd> </dd> 324<dt>exception</dt> 325<dd>return any errors or warnings in this structure. </dd> 326 327<dd> </dd> 328</dl> 329<h2><a href="../../api/MagickCore/attribute_8c.html" id="SetImageDepth">SetImageDepth</a></h2> 330 331<p>SetImageDepth() sets the depth of the image.</p> 332 333<p>The format of the SetImageDepth method is:</p> 334 335<pre class="text"> 336MagickBooleanType SetImageDepth(Image *image,const size_t depth, 337 ExceptionInfo *exception) 338</pre> 339 340<p>A description of each parameter follows:</p> 341 342<dd> 343</dd> 344 345<dd> </dd> 346<dl class="dl-horizontal"> 347<dt>image</dt> 348<dd>the image. </dd> 349 350<dd> </dd> 351<dt>channel</dt> 352<dd>the channel. </dd> 353 354<dd> </dd> 355<dt>depth</dt> 356<dd>the image depth. </dd> 357 358<dd> </dd> 359<dt>exception</dt> 360<dd>return any errors or warnings in this structure. </dd> 361 362<dd> </dd> 363</dl> 364<h2><a href="../../api/MagickCore/attribute_8c.html" id="SetImageType">SetImageType</a></h2> 365 366<p>SetImageType() sets the type of image. Choose from these types:</p> 367 368<p>Bilevel Grayscale GrayscaleMatte Palette PaletteMatte TrueColor TrueColorMatte ColorSeparation ColorSeparationMatte OptimizeType</p> 369 370<p>The format of the SetImageType method is:</p> 371 372<pre class="text"> 373MagickBooleanType SetImageType(Image *image,const ImageType type, 374 ExceptionInfo *exception) 375</pre> 376 377<p>A description of each parameter follows:</p> 378 379<dd> 380</dd> 381 382<dd> </dd> 383<dl class="dl-horizontal"> 384<dt>image</dt> 385<dd>the image. </dd> 386 387<dd> </dd> 388<dt>type</dt> 389<dd>Image type. </dd> 390 391<dd> </dd> 392<dt>exception</dt> 393<dd>return any errors or warnings in this structure. </dd> 394 395<dd> </dd> 396</dl> 397</div> 398 </div> 399 </main><!-- /.container --> 400 <footer class="magick-footer"> 401 <p><a href="../../www/www/security-policy.html">Security</a> • 402 <a href="../../www/www/architecture.html">Architecture</a> 403 404 <a href="attribute.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../../www/images/wand.ico"/></a> 405 406 <a href="../../www/www/links.html">Related</a> • 407 <a href="../../www/www/sitemap.html">Sitemap</a> 408 <br/> 409 <a href="../../www/www/support.html">Donate</a> • 410 <a href="http://pgp.mit.edu/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> • 411 <a href="../../www/www/contact.html">Contact Us</a> 412 <br/> 413 <small>© 1999-2020 ImageMagick Studio LLC</small></p> 414 </footer> 415 416 <!-- Javascript assets --> 417 <script src="../../www/assets/magick.js" crossorigin="anonymous"></script> 418 <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.4.1/jquery.min.js"><\/script>')</script> 419</body> 420</html> 421<!-- Magick Cache 4th January 2020 12:06 -->