Re: [csswg-drafts] [css-images-3] image-rendering:pixelated should not force "nearest neighbor" (or similar) when the scale factor is far from an interger (e.g. 150%) (#5837)

> The behaviour I'd like to have available to me for the purpose of a game engine is for it to display the biggest possible image that will fit within the bounds of the canvas, centered inside it, where all upscaled pixels are the same size. (It's a pretty standard approach).

That's different from what's being asked about here, and is probably a good fit for an [object-fit](https://drafts.csswg.org/css-images/#the-object-fit) value, probably as a modifier alongside `cover`/`contain`. Then you could apply `object-position: center` to position it as you described. Could you raise this as a separate issue?

---------

Okay, so the proposed behavior is to scale up to the nearest integer multiple of the natural size that doesn't overshoot the actual scaling factor, using NN to maintain pixelation, then use `auto` scaling to finish reaching the desired scale factor. This sounds pretty reasonable, agenda+ to discuss.

Important point for discussion - would this be okay to just build in as the behavior of `pixelated`? Especially on half-scales like 1.5x or 2.5x the NN behavior already looks **bad**; would it be better to default these cases into being *slightly* smoothed? Or should we keep `pixelated` as *strictly* NN, and add a variant keyword for this behavior? I lean toward baking this into `pixelated`.

-- 
GitHub Notification of comment by tabatkins
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/5837#issuecomment-776296281 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 9 February 2021 22:48:16 UTC