-6

Generated transparent pixel in Photoshop.

On PC it looks like expected, on iPhone it looks darker.

http://jsfiddle.net/QMrLB/

div {
    background-image: url('/images/pixel-white.png');
}

Browsers:

PC - Chrome version 22.0.1229.96 m

iPhone - 21.0.1180.82

Pixel: PNG-24 / Transparency layer: rgb 255 255 255, transparency 60%

Question: How to make this pixel to look same on PC, iPhone and all other browsers?

Addition:

enter image description here

enter image description here

Alex G
  • 3,048
  • 10
  • 39
  • 78

3 Answers3

3

There should be a very special reason you're not just using:

background: rgba(255,255,255,0.6);

Or something similar.

(That's not a comment, use rgba.)

Madara's Ghost
  • 172,118
  • 50
  • 264
  • 308
2

How to make this pixel to look same on PC and iPhone?

You can't. Not only does it depend on the browser, but also on the operating system and the display device as well as how the user using a device is configuring the display.

That are things you can not control from within the image nor the server-side, especially as you're trying to compare different computer systems here.

hakre
  • 193,403
  • 52
  • 435
  • 836
  • How can user of an iPhone configure his display? – Alex G Oct 27 '12 at 14:15
  • As the PC user can do that, it doesn't depend if the iPhone user can do it, too. But I'm sure she can anyway. Also only you don't like the answer, there is no reason to downvote it. Maybe you should make yourself more comfortable with digital color *models*. – hakre Oct 27 '12 at 14:16
  • We assume, that all display settings of PC and iPhone are default. – Alex G Oct 27 '12 at 14:18
  • Yes these devices *are different* by default. That is *why* you see that differently. – hakre Oct 27 '12 at 14:18
0

To achieve 100% compatibility with all browsers (IE6+), I've used recommendation from the following post:

Alpha transparent PNGs not displaying correctly in Mobile Safari

Even though the above topic is dedicated to the Mobile Safari browser ONLY - I confirm that the practice of settings transparent pixel to more than 1px of width/height is solving the issue with inconsistent look for all major browsers (IE6+).

In other words, your transparent pixel needs to be at least 2px wide/high to look like expected in all browsers as per PNG's RFC: http://www.ietf.org/rfc/rfc2083.txt.

Community
  • 1
  • 1
Alex G
  • 3,048
  • 10
  • 39
  • 78