Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Eeyo
Aug 29, 2004

Alright, so I'm making a goofy web-1.0 site. Literally just at one html and one css file stage.

I want a pixel art background image. I've set image-rendering to pixelated for the html element, which works in firefox for both background-image and <img> elements. In safari, it renders <img> elements like I want but it does not render the background how I want.

So basically:

code:
html {
  background-image: url("../images/bkg.png");
  background-repeat: repeat;
  image-rendering: pixelated;
}
Any guess as to how I may fix this?

Adbot
ADBOT LOVES YOU

Eeyo
Aug 29, 2004

Hmm it’s probably something hosed up with the way my MacBook is trying to render it then. The background image isn’t scaled, it’s just set as the background image with tiling. Same with the test image I’m including. But it’s still blurry. The image-rendering has some effect on how the page looks.

I agree that it should not though, so I’m probably asking the wrong question.

Eeyo
Aug 29, 2004

I should clarify that I already have the pixel art background and image. They’re pngs and I know that they are low resolution, have small palettes and no transparency (other than 100% transparency of the background). It’s just that it looks blurry when I include those things, except in Firefox when I include the image-rendering: pixellated.

So it’s probably fundamentally something to do with the high-dpi display I have.

Eeyo
Aug 29, 2004

Ok found a decent fix: just used image-set() with a 2x pre-scaled version.

https://developer.mozilla.org/en-US/docs/Web/CSS/image/image-set

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply