Skip to content

Commit 7a2a56e

Browse files
committed
[css-images-3] Add image-rendering example.
1 parent 1a3fed6 commit 7a2a56e

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed

css-images-3/Overview.bs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Abstract: This module contains the features of CSS level 3 relating to the <<ima
1212
Issue Tracking: Tracker http://www.w3.org/Style/CSS/Tracker/products/27
1313
Previous Version: http://www.w3.org/TR/2012/CR-css3-images-20120417/
1414
Previous Version: http://www.w3.org/TR/2012/WD-css3-images-20120112/
15-
Ignored Terms: <offset>, background positioning area, border image area, <meetorslice>, <ending-shape>, Map, center
15+
Ignored Terms: <offset>, background positioning area, border image area, <meetorslice>, <ending-shape>, Map, center, content
1616
Link Defaults: css21 (property) display
1717
</pre>
1818

@@ -1885,6 +1885,38 @@ Determing How To Scale an Image: the 'image-rendering' property {#the-image-rend
18851885
a user agent might scale images with nearest-neighbor interpolation by default,
18861886
and switch to EPX interpolation in low-load situations.
18871887

1888+
<div class='example'>
1889+
For example, given the following small image:
1890+
1891+
<figure>
1892+
<img src="images/pixel-art-small.png">
1893+
<figcaption>A small pixel-art image.
1894+
</figure>
1895+
1896+
Scaling it up 3x might look like the following,
1897+
depending on the value of 'image-rendering':
1898+
1899+
<figure>
1900+
<img src="images/pixel-art-small.png" width=384>
1901+
<figcaption>The image scaled with ''image-rendering/auto''</figcaption>
1902+
</figure>
1903+
1904+
<figure>
1905+
<img src="images/pixel-art-nn.png">
1906+
<figcaption>The image scaled with ''pixelated''</figcaption>
1907+
</figure>
1908+
1909+
<figure>
1910+
<img src="images/pixel-art-smooth.png">
1911+
<figcaption>
1912+
The image scaled with ''crisp-edges''.<br>
1913+
<small>(Or it might look like ''pixelated'',
1914+
or as another type of pixel-scaling algorithm,
1915+
depending on the browser.)</small>
1916+
</figcaption>
1917+
</figure>
1918+
</div>
1919+
18881920
This property previously accepted the values ''optimizeSpeed'' and ''optimizeQuality''.
18891921
These are now deprecated;
18901922
a user agent must accept them as valid values

css-images-3/images/pixel-art-nn.png

1.72 KB
Loading
5.04 KB
Loading
5.25 KB
Loading

0 commit comments

Comments
 (0)