Skip to content

Commit f027c05

Browse files
committed
Image
1 parent c132f25 commit f027c05

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2695,11 +2695,11 @@ from PIL import Image
26952695
```
26962696

26972697
```python
2698-
<Image> = Image.new('<mode>', (width, height))
2699-
<Image> = Image.open(<path>)
2700-
<Image> = <Image>.convert('<mode>')
2701-
<Image>.save(<path>)
2702-
<Image>.show()
2698+
<Image> = Image.new('<mode>', (width, height)) # Also: `color=<int/tuple>`.
2699+
<Image> = Image.open(<path>) # Identifies format based on file contents.
2700+
<Image> = <Image>.convert('<mode>') # Converts image to the new mode.
2701+
<Image>.save(<path>) # Selects format based on the path extension.
2702+
<Image>.show() # Opens image in default preview app.
27032703
```
27042704

27052705
```python

index.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,11 +2329,11 @@
23292329
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
23302330
</code></pre></div>
23312331

2332-
<pre><code class="python language-python hljs">&lt;Image&gt; = Image.new(<span class="hljs-string">'&lt;mode&gt;'</span>, (width, height))
2333-
&lt;Image&gt; = Image.open(&lt;path&gt;)
2334-
&lt;Image&gt; = &lt;Image&gt;.convert(<span class="hljs-string">'&lt;mode&gt;'</span>)
2335-
&lt;Image&gt;.save(&lt;path&gt;)
2336-
&lt;Image&gt;.show()
2332+
<pre><code class="python language-python hljs">&lt;Image&gt; = Image.new(<span class="hljs-string">'&lt;mode&gt;'</span>, (width, height)) <span class="hljs-comment"># Also: `color=&lt;int/tuple&gt;`.</span>
2333+
&lt;Image&gt; = Image.open(&lt;path&gt;) <span class="hljs-comment"># Identifies format based on file contents.</span>
2334+
&lt;Image&gt; = &lt;Image&gt;.convert(<span class="hljs-string">'&lt;mode&gt;'</span>) <span class="hljs-comment"># Converts image to the new mode.</span>
2335+
&lt;Image&gt;.save(&lt;path&gt;) <span class="hljs-comment"># Selects format based on the path extension.</span>
2336+
&lt;Image&gt;.show() <span class="hljs-comment"># Opens image in default preview app.</span>
23372337
</code></pre>
23382338
<pre><code class="python language-python hljs">&lt;int/tuple&gt; = &lt;Image&gt;.getpixel((x, y)) <span class="hljs-comment"># Returns a pixel.</span>
23392339
&lt;Image&gt;.putpixel((x, y), &lt;int/tuple&gt;) <span class="hljs-comment"># Writes a pixel to the image.</span>

0 commit comments

Comments
 (0)