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