Skip to content

Commit 07537e1

Browse files
committed
Image
1 parent 68d5a9a commit 07537e1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2728,7 +2728,7 @@ from PIL import Image
27282728
```python
27292729
WIDTH, HEIGHT = 100, 100
27302730
size = WIDTH * HEIGHT
2731-
hues = [255 * i/size for i in range(size)]
2731+
hues = (255 * i/size for i in range(size))
27322732
img = Image.new('HSV', (WIDTH, HEIGHT))
27332733
img.putdata([(int(h), 255, 255) for h in hues])
27342734
img.convert('RGB').save('test.png')

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2353,7 +2353,7 @@
23532353
<li><strong><code class="python hljs"><span class="hljs-string">'HSV'</span></code> - 3x8-bit pixels, Hue, Saturation, Value color space.</strong></li>
23542354
</ul><div><h3 id="examples">Examples</h3><div><h4 id="createsapngimageofarainbowgradient">Creates a PNG image of a rainbow gradient:</h4><pre><code class="python language-python hljs">WIDTH, HEIGHT = <span class="hljs-number">100</span>, <span class="hljs-number">100</span>
23552355
size = WIDTH * HEIGHT
2356-
hues = [<span class="hljs-number">255</span> * i/size <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> range(size)]
2356+
hues = (<span class="hljs-number">255</span> * i/size <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> range(size))
23572357
img = Image.new(<span class="hljs-string">'HSV'</span>, (WIDTH, HEIGHT))
23582358
img.putdata([(int(h), <span class="hljs-number">255</span>, <span class="hljs-number">255</span>) <span class="hljs-keyword">for</span> h <span class="hljs-keyword">in</span> hues])
23592359
img.convert(<span class="hljs-string">'RGB'</span>).save(<span class="hljs-string">'test.png'</span>)

0 commit comments

Comments
 (0)