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: Get or Set Image Channels @ 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:, get, or, set, image, channels, 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="channel.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="channel.html#ChannelFxImage">ChannelFxImage</a> • <a href="channel.html#CombineImages">CombineImages</a> • <a href="channel.html#GetImageAlphaChannel">GetImageAlphaChannel</a> • <a href="channel.html#SeparateImage">SeparateImage</a> • <a href="channel.html#SeparateImages">SeparateImages</a> • <a href="channel.html#SetImageAlphaChannel">SetImageAlphaChannel</a></p> 85 86 <h2><a href="../../api/MagickCore/channel_8c.html" id="ChannelFxImage">ChannelFxImage</a></h2> 87 88 <p>ChannelFxImage() applies a channel expression to the specified image. The expression consists of one or more channels, either mnemonic or numeric (e.g. red, 1), separated by actions as follows:</p> 89 90 <dd> 91 </dd> 92 93 <dd> <=> exchange two channels (e.g. red<=>blue) => copy one channel to another channel (e.g. red=>green) = assign a constant value to a channel (e.g. red=50) , write new image channels in the specified order (e.g. red, green) | add a new output image for the next set of channel operations ; move to the next input image for the source of channel data </dd> 94 95 <dd> For example, to create 3 grayscale images from the red, green, and blue channels of an image, use: </dd> 96 97 <pre class="text"> 98 -channel-fx "red; green; blue" 99 </pre> 100 101 <p>A channel without an operation symbol implies separate (i.e, semicolon). </dd> 102 103 <dd> The format of the ChannelFxImage method is: </dd> 104 105 <pre class="text"> 106 Image *ChannelFxImage(const Image *image,const char *expression, 107 ExceptionInfo *exception) 108 </pre> 109 110 <p>A description of each parameter follows: </dd> 111 112 <dd> 113 </dd> 114 115 <dd> </dd> 116 <dl class="dl-horizontal"> 117 <dt>image</dt> 118 <dd>the image. </dd> 119 120 <dd> </dd> 121 <dt>expression</dt> 122 <dd>A channel expression. </dd> 123 124 <dd> </dd> 125 <dt>exception</dt> 126 <dd>return any errors or warnings in this structure. </dd> 127 128 <dd> </dd> 129 </dl> 130 <h2><a href="../../api/MagickCore/channel_8c.html" id="CombineImages">CombineImages</a></h2> 131 132 <p>CombineImages() combines one or more images into a single image. The grayscale value of the pixels of each image in the sequence is assigned in order to the specified channels of the combined image. The typical ordering would be image 1 => Red, 2 => Green, 3 => Blue, etc.</p> 133 134 <p>The format of the CombineImages method is:</p> 135 136 <pre class="text"> 137 Image *CombineImages(const Image *images,const ColorspaceType colorspace, 138 ExceptionInfo *exception) 139 </pre> 140 141 <p>A description of each parameter follows:</p> 142 143 <dd> 144 </dd> 145 146 <dd> </dd> 147 <dl class="dl-horizontal"> 148 <dt>images</dt> 149 <dd>the image sequence. </dd> 150 151 <dd> </dd> 152 <dt>colorspace</dt> 153 <dd>the image colorspace. </dd> 154 155 <dd> </dd> 156 <dt>exception</dt> 157 <dd>return any errors or warnings in this structure. </dd> 158 159 <dd> </dd> 160 </dl> 161 <h2><a href="../../api/MagickCore/channel_8c.html" id="GetImageAlphaChannel">GetImageAlphaChannel</a></h2> 162 163 <p>GetImageAlphaChannel() returns MagickFalse if the image alpha channel is not activated. That is, the image is RGB rather than RGBA or CMYK rather than CMYKA.</p> 164 165 <p>The format of the GetImageAlphaChannel method is:</p> 166 167 <pre class="text"> 168 MagickBooleanType GetImageAlphaChannel(const Image *image) 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 </dl> 183 <h2><a href="../../api/MagickCore/channel_8c.html" id="SeparateImage">SeparateImage</a></h2> 184 185 <p>SeparateImage() separates a channel from the image and returns it as a grayscale image.</p> 186 187 <p>The format of the SeparateImage method is:</p> 188 189 <pre class="text"> 190 Image *SeparateImage(const Image *image,const ChannelType channel, 191 ExceptionInfo *exception) 192 </pre> 193 194 <p>A description of each parameter follows:</p> 195 196 <dd> 197 </dd> 198 199 <dd> </dd> 200 <dl class="dl-horizontal"> 201 <dt>image</dt> 202 <dd>the image. </dd> 203 204 <dd> </dd> 205 <dt>channel</dt> 206 <dd>the image channel. </dd> 207 208 <dd> </dd> 209 <dt>exception</dt> 210 <dd>return any errors or warnings in this structure. </dd> 211 212 <dd> </dd> 213 </dl> 214 <h2><a href="../../api/MagickCore/channel_8c.html" id="SeparateImages">SeparateImages</a></h2> 215 216 <p>SeparateImages() returns a separate grayscale image for each channel specified.</p> 217 218 <p>The format of the SeparateImages method is:</p> 219 220 <pre class="text"> 221 Image *SeparateImages(const Image *image,ExceptionInfo *exception) 222 </pre> 223 224 <p>A description of each parameter follows:</p> 225 226 <dd> 227 </dd> 228 229 <dd> </dd> 230 <dl class="dl-horizontal"> 231 <dt>image</dt> 232 <dd>the image. </dd> 233 234 <dd> </dd> 235 <dt>exception</dt> 236 <dd>return any errors or warnings in this structure. </dd> 237 238 <dd> </dd> 239 </dl> 240 <h2><a href="../../api/MagickCore/channel_8c.html" id="SetImageAlphaChannel">SetImageAlphaChannel</a></h2> 241 242 <p>SetImageAlphaChannel() activates, deactivates, resets, or sets the alpha channel.</p> 243 244 <p>The format of the SetImageAlphaChannel method is:</p> 245 246 <pre class="text"> 247 MagickBooleanType SetImageAlphaChannel(Image *image, 248 const AlphaChannelOption alpha_type,ExceptionInfo *exception) 249 </pre> 250 251 <p>A description of each parameter follows:</p> 252 253 <dd> 254 </dd> 255 256 <dd> </dd> 257 <dl class="dl-horizontal"> 258 <dt>image</dt> 259 <dd>the image. </dd> 260 261 <dd> </dd> 262 <dt>alpha_type</dt> 263 <dd> The alpha channel type: ActivateAlphaChannel, AssociateAlphaChannel, CopyAlphaChannel, DeactivateAlphaChannel, DisassociateAlphaChannel, ExtractAlphaChannel, OffAlphaChannel, OnAlphaChannel, OpaqueAlphaChannel, SetAlphaChannel, ShapeAlphaChannel, and TransparentAlphaChannel. </dd> 264 265 <dd> </dd> 266 <dt>exception</dt> 267 <dd>return any errors or warnings in this structure. </dd> 268 269 <dd> </dd> 270 </dl> 271 </div> 272 </div> 273 </main><!-- /.container --> 274 <footer class="magick-footer"> 275 <p><a href="../../www/security-policy.html">Security</a> 276 <a href="../../www/architecture.html">Architecture</a> 277 <a href="../../www/links.html">Related</a> 278 <a href="../../www/sitemap.html">Sitemap</a> 279 280 <a href="channel.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../../images/wand.ico"/></a> 281 282 <a href="http://pgp.mit.edu/pks/lookup?op=get&search=0x89AB63D48277377A">Public Key</a> 283 <a href="../../www/support.html">Donate</a> 284 <a href="../../www/contact.html">Contact Us</a> 285 <br/> 286 <small> 1999-2019 ImageMagick Studio LLC</small></p> 287 </footer> 288 289 <!-- Javascript assets --> 290 <script src="../assets/magick.js" crossorigin="anonymous"></script> 291 <script>window.jQuery || document.write('<script src="https://localhost/ajax/libs/jquery/3.3.1/jquery.min.js"><\/script>')</script> 292 </body> 293 </html> 294 <!-- Magick Cache 1st January 2019 19:40 -->