blob: 6b020914bde9392c7598c87513fe37b3ba29ab9c [file] [log] [blame]
Cristy594d2772015-11-15 10:47:42 -05001
2
3
4
cristy29dc8652015-05-12 16:26:21 +00005<!DOCTYPE html>
cristy44443b92015-05-05 00:06:07 +00006<html lang="en">
cristy06f63f22012-10-31 00:50:07 +00007<head>
Cristy594d2772015-11-15 10:47:42 -05008 <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
cristy29f2c972015-07-28 13:37:46 +00009 <title>ImageMagick: MagickCore, C API for ImageMagick: Set Text Attributes</title>
Cristy594d2772015-11-15 10:47:42 -050010 <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 Bézier 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"/>
Cristyce4a3552015-12-14 13:53:35 -050022 <meta name="copyright" content="Copyright (c) 1999-2015 ImageMagick Studio LLC"/>
Cristy594d2772015-11-15 10:47:42 -050023 <meta name="distribution" content="Global"/>
24 <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1"/>
25 <link rel="icon" href="../images/wand.png"/>
26 <link rel="shortcut icon" href="../images/wand.ico"/>
27 <link rel="stylesheet" href="../css/magick.html"/>
cristy06f63f22012-10-31 00:50:07 +000028</head>
cristy44443b92015-05-05 00:06:07 +000029<body>
cristy06f63f22012-10-31 00:50:07 +000030<div class="main">
cristy44443b92015-05-05 00:06:07 +000031<div class="magick-masthead">
32 <div class="container">
Cristye93be682015-11-26 09:07:51 -050033 <script async="async" src="http://localhost/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle"
Cristy594d2772015-11-15 10:47:42 -050034 style="display:block"
35 data-ad-client="ca-pub-3129977114552745"
36 data-ad-slot="6345125851"
37 data-ad-format="auto"></ins>
cristy29f2c972015-07-28 13:37:46 +000038 <script>
Cristy542697a2015-10-12 20:10:32 -040039 (adsbygoogle = window.adsbygoogle || []).push({});
cristy44443b92015-05-05 00:06:07 +000040 </script>
cristy44443b92015-05-05 00:06:07 +000041 <nav class="magick-nav">
cristy2f563d42015-05-06 23:36:51 +000042 <a class="magick-nav-item " href="../index.html">Home</a>
cristyea2793e2015-05-31 16:52:26 +000043 <a class="magick-nav-item " href="../binary-releases.html">Download</a>
cristy38185362015-05-07 20:09:56 +000044 <a class="magick-nav-item " href="../command-line-tools.html">Tools</a>
Cristye93be682015-11-26 09:07:51 -050045 <a class="magick-nav-item " href="../command-line-processing.html">Command-line</a>
cristyea2793e2015-05-31 16:52:26 +000046 <a class="magick-nav-item " href="../resources.html">Resources</a>
47 <a class="magick-nav-item " href="api.html">Develop</a>
cristy5b8fe762015-06-09 16:24:03 +000048 <a class="magick-nav-item " href="http://nextgen.imagemagick.org/script/search.php">Search</a>
cristya1890f02015-05-15 23:32:44 +000049 <a class="magick-nav-item pull-right" href="http://www.imagemagick.org/discourse-server/">Community</a>
cristy44443b92015-05-05 00:06:07 +000050 </nav>
51 </div>
52</div>
53<div class="container">
cristy4e638cd2015-05-07 16:47:40 +000054<div class="magick-header">
Cristy594d2772015-11-15 10:47:42 -050055<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>
cristy06f63f22012-10-31 00:50:07 +000056
Cristye93be682015-11-26 09:07:51 -050057<h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="GetImageDepth">GetImageDepth</a></h2>
cristycecc9492015-06-09 16:53:50 +000058
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">
64size_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>
Cristye93be682015-11-26 09:07:51 -050083<h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="GetImageQuantumDepth">GetImageQuantumDepth</a></h2>
cristycecc9492015-06-09 16:53:50 +000084
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">
90size_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>
Cristye93be682015-11-26 09:07:51 -0500110<h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="GetImageType">GetImageType</a></h2>
cristycecc9492015-06-09 16:53:50 +0000111
cristye1319bc2015-07-28 15:36:26 +0000112<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">
119ImageType 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>
Cristye93be682015-11-26 09:07:51 -0500134<h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="IdentifyImageGray">IdentifyImageGray</a></h2>
cristye1319bc2015-07-28 15:36:26 +0000135
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">
141ImageType 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>
Cristye93be682015-11-26 09:07:51 -0500160<h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="IdentifyImageMonochrome">IdentifyImageMonochrome</a></h2>
cristye1319bc2015-07-28 15:36:26 +0000161
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">
167MagickBooleanType 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>
Cristye93be682015-11-26 09:07:51 -0500187<h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="IdentifyImageType">IdentifyImageType</a></h2>
cristye1319bc2015-07-28 15:36:26 +0000188
189<p>IdentifyImageType() returns the potential type of image:</p>
cristycecc9492015-06-09 16:53:50 +0000190
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">
cristye1319bc2015-07-28 15:36:26 +0000196 (void) SetImageType(image,IdentifyImageType(image,exception),exception);
cristycecc9492015-06-09 16:53:50 +0000197</pre>
198
cristye1319bc2015-07-28 15:36:26 +0000199<p>The format of the IdentifyImageType method is:</p>
cristycecc9492015-06-09 16:53:50 +0000200
201<pre class="text">
cristye1319bc2015-07-28 15:36:26 +0000202ImageType IdentifyImageType(const Image *image,ExceptionInfo *exception)
cristycecc9492015-06-09 16:53:50 +0000203</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>
Cristye93be682015-11-26 09:07:51 -0500221<h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="IsImageGray">IsImageGray</a></h2>
cristycecc9492015-06-09 16:53:50 +0000222
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">
228MagickBooleanType 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>
Cristye93be682015-11-26 09:07:51 -0500243<h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="IsImageMonochrome">IsImageMonochrome</a></h2>
cristycecc9492015-06-09 16:53:50 +0000244
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">
250MagickBooleanType 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>
Cristye93be682015-11-26 09:07:51 -0500265<h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="IsImageOpaque">IsImageOpaque</a></h2>
cristycecc9492015-06-09 16:53:50 +0000266
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">
274MagickBooleanType 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>
Cristye93be682015-11-26 09:07:51 -0500294<h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="SetImageDepth">SetImageDepth</a></h2>
cristycecc9492015-06-09 16:53:50 +0000295
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">
301MagickBooleanType 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>
Cristye93be682015-11-26 09:07:51 -0500329<h2><a href="http://www.imagemagick.org/api/MagickCore/attribute_8c.html" id="SetImageType">SetImageType</a></h2>
cristycecc9492015-06-09 16:53:50 +0000330
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">
338MagickBooleanType 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>
cristy06f63f22012-10-31 00:50:07 +0000362</div>
cristy44443b92015-05-05 00:06:07 +0000363 <footer class="magick-footer">
cristy29f2c972015-07-28 13:37:46 +0000364 <p><a href="../support.html">Donate</a>
365 <a href="../sitemap.html">Sitemap</a>
cristy38185362015-05-07 20:09:56 +0000366 <a href="../links.html">Related</a>
cristy29f2c972015-07-28 13:37:46 +0000367 <a href="../architecture.html">Architecture</a>
cristy44443b92015-05-05 00:06:07 +0000368</p>
369 <p><a href="attribute.html#">Back to top</a>
cristyea2793e2015-05-31 16:52:26 +0000370 <a href="http://pgp.mit.edu:11371/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a>
cristy5b8fe762015-06-09 16:24:03 +0000371 <a href="http://nextgen.imagemagick.org/script/contact.php">Contact Us</a></p>
Cristyce4a3552015-12-14 13:53:35 -0500372 <p><small>© 1999-2015 ImageMagick Studio LLC</small></p>
cristy44443b92015-05-05 00:06:07 +0000373 </footer>
374</div><!-- /.container -->
cristy06f63f22012-10-31 00:50:07 +0000375
Cristye93be682015-11-26 09:07:51 -0500376 <script src="https://localhost/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
cristy29f2c972015-07-28 13:37:46 +0000377 <script src="http://nextgen.imagemagick.org/js/magick.html"></script>
cristy44cbd482013-08-04 20:53:36 +0000378</div>
cristy06f63f22012-10-31 00:50:07 +0000379</body>
cristy5a367e42015-05-05 12:39:18 +0000380</html>