You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<3d_array> = np.array(<Image_RGB/A>) <spanclass="hljs-comment"># Creates NumPy array from color image.</span>
2260
2260
<Image> = Image.fromarray(np.uint8(<array>)) <spanclass="hljs-comment"># Use <array>.clip(0, 255) to clip the values.</span>
2261
2261
</code></pre>
2262
+
<ul>
2263
+
<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>
2264
+
<li><strong>Custom filters can be applied to arrays using <codeclass="python hljs"><spanclass="hljs-string">'scipy.ndimage.convolve()'</span></code> function.</strong></li>
2265
+
</ul>
2262
2266
<div><h3id="modes-1">Modes</h3><ul>
2263
2267
<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>
2290
+
<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>
2291
+
<ImageDraw>.point((x, y)) <spanclass="hljs-comment"># Truncates floats into ints.</span>
2291
2292
<ImageDraw>.line((x1, y1, x2, y2 [, ...])) <spanclass="hljs-comment"># To get anti-aliasing use Image's resize().</span>
2292
2293
<ImageDraw>.arc((x1, y1, x2, y2), deg1, deg2) <spanclass="hljs-comment"># Always draws in clockwise direction.</span>
2293
2294
<ImageDraw>.rectangle((x1, y1, x2, y2)) <spanclass="hljs-comment"># To rotate use Image's rotate() and paste().</span>
2294
2295
<ImageDraw>.polygon((x1, y1, x2, y2, ...)) <spanclass="hljs-comment"># Last point gets connected to the first.</span>
2295
2296
<ImageDraw>.ellipse((x1, y1, x2, y2)) <spanclass="hljs-comment"># To rotate use Image's rotate() and paste().</span>
2296
-
</code></pre>
2297
+
</code></pre></div>
2298
+
2297
2299
<ul>
2298
2300
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'fill=<color>'</span></code> to set the primary color.</strong></li>
2299
2301
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'width=<int>'</span></code> to set the width of lines or contours.</strong></li>
0 commit comments