I'm not sure this is feasible. For one thing, how can you check an image is only 1 pixel if you haven't downloaded it?
One way might be to have a server check it for you, and hope the guy trying to log you is only checking which IP the request came from. But, if the image is uniquely sent to you, he can check if the image has been downloaded at all. I don't see a way around this. This is why all images are blocked by default on most mail clients.
UPDATE:
It might be possible to filter out some 1px images though. You can look in the width and height attributes of all the tags in the document and check if they are 1. This is not guaranteed to work as these attributes are not necessary, but it's worth a try if you really need the functionality.
Something like:
var images = document.getElementsByTagName('img');
for(var i = 0; i < images.length; i++) {
if(images[i].height == 1 && images[i].width == 1)
images[i].src='';
}
You'll probably have to edit this a little bit. I haven't tested it.
What kind of e-mail? Gmail blocks images by default unless you've clicked "always show images from this sender." – Kyralessa – 2011-08-08T02:43:18.310
I want to see all images other than those that are 1 pixel in size. – soandos – 2011-08-08T02:45:47.260
1Keep in mind that there are a number of reasons for a 1 pixel image. They are often used as spacers (after "stretching"), eg. – Daniel R Hicks – 2011-08-10T16:28:09.527