@ -2259,6 +2259,10 @@ right = [[<span class="hljs-number">0.1</span>, <span class="hljs-number">0.6</
<3d_array> = np.array(<Image_RGB/A>) <spanclass="hljs-comment"># Creates NumPy array from color image.</span>
<Image> = Image.fromarray(np.uint8(<array>)) <spanclass="hljs-comment"># Use <array>.clip(0, 255) to clip the values.</span>
</code></pre>
<ul>
<li><strong>To edit an image use <codeclass="python hljs"><spanclass="hljs-string">'ImageEnhance'</span></code>, <codeclass="python hljs"><spanclass="hljs-string">'ImageFilter'</span></code> and <codeclass="python hljs"><spanclass="hljs-string">'ImageOps'</span></code> submodules.</strong></li>
<li><strong>Custom filters can be applied to arrays using <codeclass="python hljs"><spanclass="hljs-string">'scipy.ndimage.convolve()'</span></code> function.</strong></li>
</ul>
<div><h3id="modes-1">Modes</h3><ul>
<li><strong><codeclass="python hljs"><spanclass="hljs-string">'1'</span></code> - 1-bit pixels, black and white, stored with one pixel per byte.</strong></li>
<pre><codeclass="python language-python hljs"><ImageDraw>.point((x, y)) <spanclass="hljs-comment"># Truncates floats into ints.</span>
<div><h3id="imagedraw">Image Draw</h3><pre><codeclass="python language-python hljs"><ImageDraw> = ImageDraw.Draw(<Image>) <spanclass="hljs-comment"># Object for adding 2D graphics to the image.</span>
<ImageDraw>.point((x, y)) <spanclass="hljs-comment"># Truncates floats into ints.</span>
<ImageDraw>.line((x1, y1, x2, y2 [, ...])) <spanclass="hljs-comment"># To get anti-aliasing use Image's resize().</span>
<ImageDraw>.arc((x1, y1, x2, y2), deg1, deg2) <spanclass="hljs-comment"># Always draws in clockwise direction.</span>
<ImageDraw>.rectangle((x1, y1, x2, y2)) <spanclass="hljs-comment"># To rotate use Image's rotate() and paste().</span>
<ImageDraw>.polygon((x1, y1, x2, y2, ...)) <spanclass="hljs-comment"># Last point gets connected to the first.</span>
<ImageDraw>.ellipse((x1, y1, x2, y2)) <spanclass="hljs-comment"># To rotate use Image's rotate() and paste().</span>
</code></pre>
</code></pre></div>
<ul>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'fill=<color>'</span></code> to set the primary color.</strong></li>
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'width=<int>'</span></code> to set the width of lines or contours.</strong></li>