-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use img { image-rendering: pixelated } #1097
Comments
Does this also work for antialiased text? |
Sadly, Chrome does not seem to support switching off font anti-aliasing, see https://stackoverflow.com/questions/18786829/webkit-font-smoothing-property-has-no-effect-in-chrome I am after changing how reference/test/diff images get displayed in the HTML report in the browser: Before "pixelated": After "pixelated": This is from Mac OS X retina display, capture was done on a non-retina Puppeteer, but in my experience, even displaying images with matching dpi, Chrome still smooths the pixels anyway. |
I am realizing - this would make sense to enable only if the image takes more pixels in the browser than it has itself. If you are shrinking the image, switching off anti-aliasing might make some of the pink difference pixels disappear, confusing the user. |
Chrome automatically applies smoothing when drawing images to screen when in retina mode while the image was captured non-retina.
Since backstop's goal is to compare images, the smoothing is counterproductive. I am not seeing what the browser actually rendered - I get a blurred version instead.
The
img { image-rendering: pixelated }
style makes the image comparison render much crisper.I am currently applying this style in DevTools, but I figure this could be done automatically by backstop.js.
The text was updated successfully, but these errors were encountered: