Skip to content

Instantly share code, notes, and snippets.

@while0pass
Created November 3, 2010 13:29
Show Gist options
  • Save while0pass/661069 to your computer and use it in GitHub Desktop.
Save while0pass/661069 to your computer and use it in GitHub Desktop.
1px transparent gif image base64 encoded within data scheme url
data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
<img width="1" height="1" title="" alt="" src="data:image/gif;base64,R0lGODlhAQABAIAAAP///////yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" />
@while0pass
Copy link
Author

That's great. Thank you. It seems there was lot of unnecessary metadata in the image, because new base64 is a discontinuous substring of the previous one. Thank you once again.

@HazemNoor
Copy link

This is smaller

data:image/gif;base64,R0lGODlhAQABAAAAACw=

@mansilladev
Copy link

@HazemNoor - that shorter one seems to leave a placeholder border on some browsers and mobile devices. (even with all border CSS attributes set to none)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment