3

ASK DN: Why does this image background change?

over 9 years ago from , Dev

This is the image: https://twitter.com/TheWorldStories/status/472808427811373056/photo/1

I'm not sure why the image background changes from what you see in the preview to what it looks like when it's enlarged. Can someone explain what's happening? Thanks!

5 comments

  • Patrik HjelmPatrik Hjelm, over 9 years ago

    It doesn't change. The image that you are clicking is a transparant png with white stars and the black lines makes up the room that can be seen in the preview version. The element background on the preview site is white, whilst the element background on the clicked image is black. Thus creating the illusion of a changing image.

    6 points
  • Joe Blau, over 9 years ago (edited over 9 years ago )

    magic

    Everyone else did a good job of explaining it so here is a gif

    4 points
  • Sabih MirSabih Mir, over 9 years ago

    Yeah like others have said, it's the same image - just using transparency to take advantage of how Twitter display the same image in two different contexts.

    An easy way to see what's going on is to change the background color of the div holding clicked image to white.

    3 points
  • Joey Prijs, over 9 years ago

    It's a transparent image.

    1 point
  • Andrew LiebchenAndrew Liebchen, over 9 years ago

    That's an insightful technique! Pretty cool.

    0 points