Home | History | Annotate | Download | only in api
      1 
      2 
      3 
      4 
      5 <!DOCTYPE html>
      6 <html lang="en">
      7 <head>
      8     <title>ImageMagick: MagickCore, C API for ImageMagick: Set Text Attributes</title>
      9   <meta charset="utf-8" />
     10   <meta http-equiv="X-UA-Compatible" content="IE=edge" />
     11   <meta name="viewport" content="width=device-width, initial-scale=1" />
     12   <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
     13   <meta name="application-name" content="ImageMagick"/>
     14   <meta name="description" content="ImageMagick is a software suite to create, edit, compose, or convert bitmap images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, JPEG-2000, GIF, WebP, Postscript, PDF, and SVG. Use ImageMagick to resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bzier curves."/>
     15   <meta name="application-url" content="http://www.imagemagick.org"/>
     16   <meta name="generator" content="PHP"/>
     17   <meta name="keywords" content="magickcore, c, api, for, imagemagick:, set, text, attributes, ImageMagick, PerlMagick, image processing, image, photo, software, Magick++, OpenMP, convert"/>
     18   <meta name="rating" content="GENERAL"/>
     19   <meta name="robots" content="INDEX, FOLLOW"/>
     20   <meta name="generator" content="ImageMagick Studio LLC"/>
     21   <meta name="author" content="ImageMagick Studio LLC"/>
     22   <meta name="revisit-after" content="2 DAYS"/>
     23   <meta name="resource-type" content="document"/>
     24   <meta name="copyright" content="Copyright (c) 1999-2016 ImageMagick Studio LLC"/>
     25   <meta name="distribution" content="Global"/>
     26   <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
     27   <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
     28   <link rel="icon" href="../images/wand.png"/>
     29   <link rel="shortcut icon" href="../images/wand.ico"/>
     30   <link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Roboto:900,400,400italic,700,700italic,300,300italic|Open+Sans:300italic,400italic,700italic,300,400,600,700">
     31   <link rel="stylesheet" href="../css/magick.html"/>
     32 </head>
     33 <body>
     34 <div class="main">
     35 <div class="magick-masthead">
     36   <div class="container">
     37     <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script>    <ins class="adsbygoogle"
     38          style="display:block"
     39          data-ad-client="ca-pub-3129977114552745"
     40          data-ad-slot="6345125851"
     41          data-ad-format="auto"></ins>
     42     <script>
     43       (adsbygoogle = window.adsbygoogle || []).push({});
     44     </script>
     45     <nav class="magick-nav">
     46       <a class="magick-nav-item " href="../index.html">Home</a>
     47       <a class="magick-nav-item " href="../binary-releases.html">Download</a>
     48       <a class="magick-nav-item " href="../command-line-tools.html">Tools</a>
     49       <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a>
     50       <a class="magick-nav-item " href="../resources.html">Resources</a>
     51       <a class="magick-nav-item " href="api.html">Develop</a>
     52       <a class="magick-nav-item " href="http://www.imagemagick.org/script/search.php">Search</a>
     53       <a class="magick-nav-item pull-right" href="https://www.imagemagick.org/discourse-server/">Community</a>
     54     </nav>
     55   </div>
     56 </div>
     57 <div class="container">
     58 <div class="magick-header">
     59 <p class="text-center"><a href="attribute.html#GetImageDepth">GetImageDepth</a> &#8226; <a href="attribute.html#GetImageQuantumDepth">GetImageQuantumDepth</a> &#8226; <a href="attribute.html#GetImageType">GetImageType</a> &#8226; <a href="attribute.html#IdentifyImageGray">IdentifyImageGray</a> &#8226; <a href="attribute.html#IdentifyImageMonochrome">IdentifyImageMonochrome</a> &#8226; <a href="attribute.html#IdentifyImageType">IdentifyImageType</a> &#8226; <a href="attribute.html#IsImageGray">IsImageGray</a> &#8226; <a href="attribute.html#IsImageMonochrome">IsImageMonochrome</a> &#8226; <a href="attribute.html#IsImageOpaque">IsImageOpaque</a> &#8226; <a href="attribute.html#SetImageDepth">SetImageDepth</a> &#8226; <a href="attribute.html#SetImageType">SetImageType</a></p>
     60 
     61 <h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="GetImageDepth">GetImageDepth</a></h2>
     62 
     63 <p>GetImageDepth() returns the depth of a particular image channel.</p>
     64 
     65 <p>The format of the GetImageDepth method is:</p>
     66 
     67 <pre class="text">
     68 size_t GetImageDepth(const Image *image,ExceptionInfo *exception)
     69 </pre>
     70 
     71 <p>A description of each parameter follows:</p>
     72 
     73 <dd>
     74 </dd>
     75 
     76 <dd> </dd>
     77 <dl class="dl-horizontal">
     78 <dt>image</dt>
     79 <dd>the image. </dd>
     80 
     81 <dd> </dd>
     82 <dt>exception</dt>
     83 <dd>return any errors or warnings in this structure. </dd>
     84 
     85 <dd>  </dd>
     86 </dl>
     87 <h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="GetImageQuantumDepth">GetImageQuantumDepth</a></h2>
     88 
     89 <p>GetImageQuantumDepth() returns the depth of the image rounded to a legal quantum depth: 8, 16, or 32.</p>
     90 
     91 <p>The format of the GetImageQuantumDepth method is:</p>
     92 
     93 <pre class="text">
     94 size_t GetImageQuantumDepth(const Image *image,
     95   const MagickBooleanType constrain)
     96 </pre>
     97 
     98 <p>A description of each parameter follows:</p>
     99 
    100 <dd>
    101 </dd>
    102 
    103 <dd> </dd>
    104 <dl class="dl-horizontal">
    105 <dt>image</dt>
    106 <dd>the image. </dd>
    107 
    108 <dd> </dd>
    109 <dt>constrain</dt>
    110 <dd>A value other than MagickFalse, constrains the depth to a maximum of MAGICKCORE_QUANTUM_DEPTH. </dd>
    111 
    112 <dd>  </dd>
    113 </dl>
    114 <h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="GetImageType">GetImageType</a></h2>
    115 
    116 <p>GetImageType() returns the type of image:</p>
    117 
    118 <p>Bilevel         Grayscale        GrayscaleMatte Palette         PaletteMatte     TrueColor TrueColorMatte  ColorSeparation  ColorSeparationMatte</p>
    119 
    120 <p>The format of the GetImageType method is:</p>
    121 
    122 <pre class="text">
    123 ImageType GetImageType(const Image *image)
    124 </pre>
    125 
    126 <p>A description of each parameter follows:</p>
    127 
    128 <dd>
    129 </dd>
    130 
    131 <dd> </dd>
    132 <dl class="dl-horizontal">
    133 <dt>image</dt>
    134 <dd>the image. </dd>
    135 
    136 <dd>  </dd>
    137 </dl>
    138 <h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="IdentifyImageGray">IdentifyImageGray</a></h2>
    139 
    140 <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>
    141 
    142 <p>The format of the IdentifyImageGray method is:</p>
    143 
    144 <pre class="text">
    145 ImageType IdentifyImageGray(const Image *image,ExceptionInfo *exception)
    146 </pre>
    147 
    148 <p>A description of each parameter follows:</p>
    149 
    150 <dd>
    151 </dd>
    152 
    153 <dd> </dd>
    154 <dl class="dl-horizontal">
    155 <dt>image</dt>
    156 <dd>the image. </dd>
    157 
    158 <dd> </dd>
    159 <dt>exception</dt>
    160 <dd>return any errors or warnings in this structure. </dd>
    161 
    162 <dd>  </dd>
    163 </dl>
    164 <h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="IdentifyImageMonochrome">IdentifyImageMonochrome</a></h2>
    165 
    166 <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>
    167 
    168 <p>The format of the IdentifyImageMonochrome method is:</p>
    169 
    170 <pre class="text">
    171 MagickBooleanType IdentifyImageMonochrome(const Image *image,
    172   ExceptionInfo *exception)
    173 </pre>
    174 
    175 <p>A description of each parameter follows:</p>
    176 
    177 <dd>
    178 </dd>
    179 
    180 <dd> </dd>
    181 <dl class="dl-horizontal">
    182 <dt>image</dt>
    183 <dd>the image. </dd>
    184 
    185 <dd> </dd>
    186 <dt>exception</dt>
    187 <dd>return any errors or warnings in this structure. </dd>
    188 
    189 <dd>  </dd>
    190 </dl>
    191 <h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="IdentifyImageType">IdentifyImageType</a></h2>
    192 
    193 <p>IdentifyImageType() returns the potential type of image:</p>
    194 
    195 <p>Bilevel         Grayscale        GrayscaleMatte Palette         PaletteMatte     TrueColor TrueColorMatte  ColorSeparation  ColorSeparationMatte</p>
    196 
    197 <p>To ensure the image type matches its potential, use SetImageType():</p>
    198 
    199 <pre class="text">
    200     (void) SetImageType(image,IdentifyImageType(image,exception),exception);
    201 </pre>
    202 
    203 <p>The format of the IdentifyImageType method is:</p>
    204 
    205 <pre class="text">
    206 ImageType IdentifyImageType(const Image *image,ExceptionInfo *exception)
    207 </pre>
    208 
    209 <p>A description of each parameter follows:</p>
    210 
    211 <dd>
    212 </dd>
    213 
    214 <dd> </dd>
    215 <dl class="dl-horizontal">
    216 <dt>image</dt>
    217 <dd>the image. </dd>
    218 
    219 <dd> </dd>
    220 <dt>exception</dt>
    221 <dd>return any errors or warnings in this structure. </dd>
    222 
    223 <dd>  </dd>
    224 </dl>
    225 <h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="IsImageGray">IsImageGray</a></h2>
    226 
    227 <p>IsImageGray() returns MagickTrue if the type of the image is grayscale or bi-level.</p>
    228 
    229 <p>The format of the IsImageGray method is:</p>
    230 
    231 <pre class="text">
    232 MagickBooleanType IsImageGray(const Image *image)
    233 </pre>
    234 
    235 <p>A description of each parameter follows:</p>
    236 
    237 <dd>
    238 </dd>
    239 
    240 <dd> </dd>
    241 <dl class="dl-horizontal">
    242 <dt>image</dt>
    243 <dd>the image. </dd>
    244 
    245 <dd>  </dd>
    246 </dl>
    247 <h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="IsImageMonochrome">IsImageMonochrome</a></h2>
    248 
    249 <p>IsImageMonochrome() returns MagickTrue if type of the image is bi-level.</p>
    250 
    251 <p>The format of the IsImageMonochrome method is:</p>
    252 
    253 <pre class="text">
    254 MagickBooleanType IsImageMonochrome(const Image *image)
    255 </pre>
    256 
    257 <p>A description of each parameter follows:</p>
    258 
    259 <dd>
    260 </dd>
    261 
    262 <dd> </dd>
    263 <dl class="dl-horizontal">
    264 <dt>image</dt>
    265 <dd>the image. </dd>
    266 
    267 <dd>  </dd>
    268 </dl>
    269 <h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="IsImageOpaque">IsImageOpaque</a></h2>
    270 
    271 <p>IsImageOpaque() returns MagickTrue if none of the pixels in the image have an alpha value other than OpaqueAlpha (QuantumRange).</p>
    272 
    273 <p>Will return true immediatally is alpha channel is not available.</p>
    274 
    275 <p>The format of the IsImageOpaque method is:</p>
    276 
    277 <pre class="text">
    278 MagickBooleanType IsImageOpaque(const Image *image,
    279   ExceptionInfo *exception)
    280 </pre>
    281 
    282 <p>A description of each parameter follows:</p>
    283 
    284 <dd>
    285 </dd>
    286 
    287 <dd> </dd>
    288 <dl class="dl-horizontal">
    289 <dt>image</dt>
    290 <dd>the image. </dd>
    291 
    292 <dd> </dd>
    293 <dt>exception</dt>
    294 <dd>return any errors or warnings in this structure. </dd>
    295 
    296 <dd>  </dd>
    297 </dl>
    298 <h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="SetImageDepth">SetImageDepth</a></h2>
    299 
    300 <p>SetImageDepth() sets the depth of the image.</p>
    301 
    302 <p>The format of the SetImageDepth method is:</p>
    303 
    304 <pre class="text">
    305 MagickBooleanType SetImageDepth(Image *image,const size_t depth,
    306   ExceptionInfo *exception)
    307 </pre>
    308 
    309 <p>A description of each parameter follows:</p>
    310 
    311 <dd>
    312 </dd>
    313 
    314 <dd> </dd>
    315 <dl class="dl-horizontal">
    316 <dt>image</dt>
    317 <dd>the image. </dd>
    318 
    319 <dd> </dd>
    320 <dt>channel</dt>
    321 <dd>the channel. </dd>
    322 
    323 <dd> </dd>
    324 <dt>depth</dt>
    325 <dd>the image depth. </dd>
    326 
    327 <dd> </dd>
    328 <dt>exception</dt>
    329 <dd>return any errors or warnings in this structure. </dd>
    330 
    331 <dd>  </dd>
    332 </dl>
    333 <h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="SetImageType">SetImageType</a></h2>
    334 
    335 <p>SetImageType() sets the type of image.  Choose from these types:</p>
    336 
    337 <p>Bilevel        Grayscale       GrayscaleMatte Palette        PaletteMatte    TrueColor TrueColorMatte ColorSeparation ColorSeparationMatte OptimizeType</p>
    338 
    339 <p>The format of the SetImageType method is:</p>
    340 
    341 <pre class="text">
    342 MagickBooleanType SetImageType(Image *image,const ImageType type,
    343   ExceptionInfo *exception)
    344 </pre>
    345 
    346 <p>A description of each parameter follows:</p>
    347 
    348 <dd>
    349 </dd>
    350 
    351 <dd> </dd>
    352 <dl class="dl-horizontal">
    353 <dt>image</dt>
    354 <dd>the image. </dd>
    355 
    356 <dd> </dd>
    357 <dt>type</dt>
    358 <dd>Image type. </dd>
    359 
    360 <dd> </dd>
    361 <dt>exception</dt>
    362 <dd>return any errors or warnings in this structure. </dd>
    363 
    364 <dd>  </dd>
    365 </dl>
    366 </div>
    367   <footer class="magick-footer">
    368     <p><a href="../support.html">Donate</a> 
    369      <a href="../sitemap.html">Sitemap</a> 
    370     <a href="../links.html">Related</a> 
    371     <a href="../architecture.html">Architecture</a>
    372 </p>
    373     <p><a href="attribute.html#">Back to top</a> 
    374     <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> 
    375     <a href="http://www.imagemagick.org/script/contact.php">Contact Us</a></p>
    376         <p><small>  1999-2016 ImageMagick Studio LLC</small></p>
    377   </footer>
    378 </div><!-- /.container -->
    379 
    380   <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    381   <script src="../js/magick.html"></script>
    382 </div>
    383 </body>
    384 </html>
    385