multispectral-imagery.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1" />
  6. <title>ImageMagick – Multispectral Imagery</title>
  7. <meta name="application-name" content="ImageMagick" />
  8. <meta name="description" content="" />
  9. <meta name="application-url" content="https://imagemagick.org" />
  10. <meta name="generator" content="PHP" />
  11. <meta name="keywords" content="multispectral, imagery, image processing software" />
  12. <meta name="rating" content="GENERAL" />
  13. <meta name="robots" content="INDEX, FOLLOW" />
  14. <meta name="generator" content="ImageMagick Studio LLC" />
  15. <meta name="author" content="ImageMagick Studio LLC" />
  16. <meta name="revisit-after" content="2 DAYS" />
  17. <meta name="resource-type" content="document" />
  18. <meta name="copyright" content="Copyright (c) 1999 ImageMagick Studio LLC" />
  19. <meta name="distribution" content="Global" />
  20. <meta name="magick-serial" content="P131-S030410-R485315270133-P82224-A6668-G1245-1" />
  21. <meta property='og:url' content='../' />
  22. <meta property='og:title' content='ImageMagick' />
  23. <meta property='og:image' content='../images/logo.png' />
  24. <meta property='og:type' content='website' />
  25. <meta property='og:site_name' content='ImageMagick' />
  26. <meta property='og:description' content="Create, Edit, Compose, or Convert Digital Images" />
  27. <meta name="google-site-verification" content="_bMOCDpkx9ZAzBwb2kF3PRHbfUUdFj2uO8Jd1AXArz4" />
  28. <link href="multispectral-imagery.html" rel="canonical" />
  29. <link href="../images/wand.png" rel="icon" />
  30. <link href="../images/wand.ico" rel="shortcut icon" />
  31. <link href="assets/magick.css" rel="stylesheet" />
  32. </head>
  33. <body>
  34. <nav class="navbar navbar-expand-md navbar-dark bg-dark fixed-top">
  35. <div class="container-fluid">
  36. <a class="navbar-brand" href="../"><img class="d-block" id="icon" alt="ImageMagick" width="32" height="32" src="../images/wand.ico"/></a>
  37. <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#magick-navbars" aria-controls="magick-navbars" aria-expanded="false" aria-label="Toggle navigation">
  38. <span class="navbar-toggler-icon"></span>
  39. </button>
  40. <div class="collapse navbar-collapse" id="magick-navbars">
  41. <ul class="navbar-nav me-auto mb-2 mb-md-0">
  42. <li class="nav-item">
  43. <a class="nav-link " href="../www/download.html">Download</a>
  44. </li>
  45. <li class="nav-item">
  46. <a class="nav-link " href="../www/command-line-tools.html">Tools</a>
  47. </li>
  48. <li class="nav-item">
  49. <a class="nav-link " href="../www/command-line-processing.html">CLI</a>
  50. </li>
  51. <li class="nav-item">
  52. <a class="nav-link " href="../www/develop.html">Develop</a>
  53. </li>
  54. <li class="nav-item">
  55. <a class="nav-link" target="_blank" href="https://github.com/ImageMagick/ImageMagick/discussions">Community</a>
  56. </li>
  57. <li class="nav-item">
  58. <iframe src="https://github.com/sponsors/ImageMagick/button" title="Sponsor ImageMagick" height="35" width="107" style="border: 0;"></iframe>
  59. </li>
  60. </ul>
  61. <form class="d-flex form-inline" action="search.html">
  62. <input class="form-control me-2" type="text" name="q" placeholder="Search" aria-label="Search">
  63. <button class="btn btn-outline-success" type="submit" name="sa">Search</button>
  64. </form>
  65. </div>
  66. </div>
  67. </nav>
  68. <div class="container">
  69. <script async="async" src="https://localhost/pagead/js/adsbygoogle.js"></script>
  70. <ins class="adsbygoogle"
  71. style="display:block"
  72. data-ad-client="ca-pub-3129977114552745"
  73. data-ad-slot="6345125851"
  74. data-full-width-responsive="true"
  75. data-ad-format="horizontal"></ins>
  76. <script>
  77. (adsbygoogle = window.adsbygoogle || []).push({});
  78. </script>
  79. </div>
  80. <main class="container">
  81. <div class="magick-template">
  82. <div class="magick-header">
  83. <h1 class="text-center">Multispectral Imagery</h1>
  84. <p class="lead magick-description">Multispectral imagery refers to images that are captured using multiple bands of the electromagnetic spectrum, beyond just the visible light spectrum. This means that they capture data across a wider range of wavelengths, from ultraviolet to infrared.</p>
  85. <p>By capturing data across multiple spectral bands, multispectral imagery can provide additional information about the objects or scenes being imaged, such as their composition, temperature, and vegetation health. This information can be used for a wide range of applications, including agriculture, environmental monitoring, disaster response, and military surveillance.</p>
  86. <p>Multispectral imagery is often captured using specialized sensors on satellites, drones, or aircraft. The data is then processed using specialized software to create images that display the information captured in each spectral band.</p>
  87. <p>Overall, multispectral imagery provides a powerful tool for analyzing and understanding the world around us, allowing us to gain insights that would be impossible to obtain using visible light imagery alone.</p>
  88. <h4>Multispectral Support in ImageMagick</h4>
  89. <p>ImageMagick supports multispectral images where all channels have the same dimensions and number of pixels as the original image. However, not all image formats support multispectral images. PSD, TIFF, MIFF, MPC, and <a href="http://im.snibgo.com/fmttxt.htm">FTXT</a> have full support for multispectral images up to 31 bands with 21 meta channels. If you build ImageMagick with the configure script <samp>--enable-64bit-channel-masks</samp> option, you can process 63 band multispectral images with up to 53 meta channels.</p>
  90. <p>We call image channels beyond the standard RGB(A) or CMYK(A) channels, "meta" channels. We label them as "meta", "meta1", "meta2", etc.. Meta channels are treated the same as any other channel meaning they can be read, written, and operated upon-- e.g., resized, gamma adjusted, etc.</p>
  91. <h5>Create a Multispectral Image</h5>
  92. <p>Begin with a multispectral image, typically in the TIFF or PSD format. If you don't have one, you can create your own. In our example, we create a single CMYK pixel with two meta channels. Stuff this in a file titled <code>multiMeta.txt</code>:</p>
  93. <pre class="bg-light text-dark mx-4"><samp>0,0: 10,20,30,40,50,60</samp></pre>
  94. <p>Let's convert that to the TIFF image format:</p>
  95. <pre class="bg-light text-dark mx-4"><samp>$ magick -size 1x1 -colorspace CMYK -define ftxt:format="\x,\y:\c\n" -define ftxt:hasalpha=false -define ftxt:nummeta=2 ftxt:multiMeta.txt multiMeta.tif</samp></pre>
  96. <p>Let confirm that worked as expected:<p>
  97. <pre class="pre-scrollable bg-light text-dark mx-4"><samp>$ identify -verbose multiMeta.tif
  98. Image:
  99. Filename: multiMeta.tif
  100. Permissions: rw-------
  101. Format: TIFF (Tagged Image File Format)
  102. Mime type: images/tiff
  103. Class: DirectClass
  104. Geometry: 1x1+0+0
  105. Units: PixelsPerInch
  106. Colorspace: CMYK
  107. Type: ColorSeparation
  108. Endianness: LSB
  109. Depth: 16-bit
  110. Channels: 6.2
  111. Channel depth:
  112. Cyan: 16-bit
  113. Magenta: 16-bit
  114. Yellow: 16-bit
  115. Black: 16-bit
  116. Meta channel[0]: 16-bit
  117. Meta channel[1]: 16-bit
  118. Channel statistics:
  119. Pixels: 1
  120. Cyan:
  121. min: 10 (0.00015259)
  122. max: 10 (0.00015259)
  123. mean: 10 (0.00015259)
  124. median: 10 (0.00015259)
  125. standard deviation: 0 (0)
  126. kurtosis: -3
  127. skewness: 0
  128. entropy: 0
  129. Magenta:
  130. min: 20 (0.00030518)
  131. max: 20 (0.00030518)
  132. mean: 20 (0.00030518)
  133. median: 20 (0.00030518)
  134. standard deviation: 0 (0)
  135. kurtosis: -3
  136. skewness: 0
  137. entropy: 0
  138. Yellow:
  139. min: 30 (0.000457771)
  140. max: 30 (0.000457771)
  141. mean: 30 (0.000457771)
  142. median: 30 (0.000457771)
  143. standard deviation: 0 (0)
  144. kurtosis: -3
  145. skewness: 0
  146. entropy: 0
  147. Black:
  148. min: 40 (0.000610361)
  149. max: 40 (0.000610361)
  150. mean: 40 (0.000610361)
  151. median: 40 (0.000610361)
  152. standard deviation: 0 (0)
  153. kurtosis: -3
  154. skewness: 0
  155. entropy: 0
  156. Meta channel[0]:
  157. min: 50 (0.000762951)
  158. max: 50 (0.000762951)
  159. mean: 50 (0.000762951)
  160. median: 50 (0.000762951)
  161. standard deviation: 0 (0)
  162. kurtosis: -3
  163. skewness: 0
  164. entropy: 0
  165. Meta channel[1]:
  166. min: 60 (0.000915541)
  167. max: 60 (0.000915541)
  168. mean: 60 (0.000915541)
  169. median: 60 (0.000915541)
  170. standard deviation: 0 (0)
  171. kurtosis: -3
  172. skewness: 0
  173. entropy: 0
  174. Image statistics:
  175. Overall:
  176. min: 10 (0.00015259)
  177. max: 60 (0.000915541)
  178. mean: 35 (0.000534066)
  179. median: 35 (0.000534066)
  180. standard deviation: 0 (0)
  181. kurtosis: -1.79762
  182. skewness: 4.44476e-15
  183. entropy: 0
  184. Total ink density: 0.15259%
  185. Colors: 1
  186. Histogram:
  187. 1: (10,20,30,40) #000A0014001E0028 cmyk(0.0389105,0.077821,0.116732,0.155642)
  188. Rendering intent: Perceptual
  189. Gamma: 0.454545
  190. Chromaticity:
  191. red primary: (0.64,0.33)
  192. green primary: (0.3,0.6)
  193. blue primary: (0.15,0.06)
  194. white point: (0.3127,0.329)
  195. Matte color: grey74
  196. Background color: white
  197. Border color: srgb(223,223,223)
  198. Transparent color: black
  199. Interlace: None
  200. Intensity: Undefined
  201. Compose: Over
  202. Page geometry: 1x1+0+0
  203. Dispose: Undefined
  204. Iterations: 0
  205. Compression: None
  206. Orientation: TopLeft
  207. Properties:
  208. date:create: 2023-03-12T11:38:42+00:00
  209. date:modify: 2023-03-12T11:38:42+00:00
  210. date:timestamp: 2023-03-12T11:38:56+00:00
  211. signature: c51848f16d296f7c95be14404cc582f49db6fd33f31b544a2ce10e440b3747b3
  212. tiff:alpha: unspecified
  213. tiff:endian: lsb
  214. tiff:photometric: separated
  215. tiff:rows-per-strip: 1
  216. Artifacts:
  217. verbose: true
  218. Tainted: False
  219. Filesize: 306B
  220. Number pixels: 1
  221. </samp></pre>
  222. <p>Notice the channel depth and statistics associated with the two meta channels.<p>
  223. <h5>Working with Multispectral Images</h5>
  224. <p>Meta channels are treated the same as any other channel meaning they can be read, written, and operated upon-- e.g., resized, gamma adjusted, etc.. Here, we replace the first channel with the contents of the meta channel:<p>
  225. <pre class="bg-light text-dark mx-4"><samp>magick multiMeta.tif -channel-fx 'meta1=>cyan' multiMeta-1.tif</samp></pre>
  226. <p>The original cyan channel has an intensity of 10. It's now, per the channel FX instructions, 50.<p>
  227. <p>And in this example, we create two meta channels:</p>
  228. <pre class="bg-light text-dark mx-4"><samp>magick lena.png \( mandril3.jpg -colorspace gray \) -channel-fx '| gray=>meta' \( zelda1.jpg -colorspace gray \) -channel-fx '| gray=>meta1' meta.tif</samp></pre>
  229. <h5>Writing Multispectral Images</h5>
  230. <p>You can preserve multispectral images by writing them to a format that supports meta channels such as TIFF or PSD. If you write to other image formats that do not support multisprectal images, the channels are not preserved and instead lost-- e.g., PNG. In this example, we read, resize, and write a multispectral image:</p>
  231. <pre class="bg-light text-dark mx-4"><samp>magick multiMeta.tif -resize 50% resizedMeta.tif</samp></pre>
  232. </div>
  233. </div>
  234. </main><!-- /.container -->
  235. <footer class="magick-footer">
  236. <div class="container-fluid">
  237. <a href="../www/security-policy.html">Security</a> •
  238. <a href="../www/news.html">News</a>
  239. <a href="multispectral-imagery.html#"><img class="d-inline" id="wand" alt="And Now a Touch of Magick" width="16" height="16" src="../images/wand.ico"/></a>
  240. <a href="../www/links.html">Related</a> •
  241. <a href="../www/sitemap.html">Sitemap</a>
  242. <br/>
  243. <a href="../www/support.html">Sponsor</a> •
  244. <a href="../www/cite.html">Cite</a> •
  245. <a href="http://pgp.mit.edu/pks/lookup?op=get&amp;search=0x89AB63D48277377A">Public Key</a> •
  246. <a href="../www/https://imagemagick.org/script/contact.php">Contact Us</a>
  247. <br/>
  248. <a href="https://github.com/imagemagick/imagemagick" target="_blank" rel="noopener" aria-label="GitHub"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 512 499.36" width="2%" height="2%" role="img" focusable="false"><title>GitHub</title><path fill="currentColor" fill-rule="evenodd" d="M256 0C114.64 0 0 114.61 0 256c0 113.09 73.34 209 175.08 242.9 12.8 2.35 17.47-5.56 17.47-12.34 0-6.08-.22-22.18-.35-43.54-71.2 15.49-86.2-34.34-86.2-34.34-11.64-29.57-28.42-37.45-28.42-37.45-23.27-15.84 1.73-15.55 1.73-15.55 25.69 1.81 39.21 26.38 39.21 26.38 22.84 39.12 59.92 27.82 74.5 21.27 2.33-16.54 8.94-27.82 16.25-34.22-56.84-6.43-116.6-28.43-116.6-126.49 0-27.95 10-50.8 26.35-68.69-2.63-6.48-11.42-32.5 2.51-67.75 0 0 21.49-6.88 70.4 26.24a242.65 242.65 0 0 1 128.18 0c48.87-33.13 70.33-26.24 70.33-26.24 14 35.25 5.18 61.27 2.55 67.75 16.41 17.9 26.31 40.75 26.31 68.69 0 98.35-59.85 120-116.88 126.32 9.19 7.9 17.38 23.53 17.38 47.41 0 34.22-.31 61.83-.31 70.23 0 6.85 4.61 14.81 17.6 12.31C438.72 464.97 512 369.08 512 256.02 512 114.62 397.37 0 256 0z"/></svg></a> •
  249. <a href="https://twitter.com/imagemagick" target="_blank" rel="noopener" aria-label="Twitter"><svg xmlns="http://www.w3.org/2000/svg" class="navbar-nav-svg" viewBox="0 0 300 300" width="2%" height="2%" role="img" focusable="false"><title>Twitter</title><path d="M178.57 127.15 290.27 0h-26.46l-97.03 110.38L89.34 0H0l117.13 166.93L0 300.25h26.46l102.4-116.59 81.8 116.59h89.34M36.01 19.54H76.66l187.13 262.13h-40.66"/></svg></a>
  250. <br/>
  251. <small>Copyright © 1999 ImageMagick Studio LLC</small>
  252. </div>
  253. </footer>
  254. <!-- Javascript assets -->
  255. <script src="assets/magick.js" ></script>
  256. </body>
  257. </html>