We are talking about the site name here. In most cases it will not be that long and it usually will be repeated several times on each page. So this should be no problem for any search engine, as it is hard to see how this could possibly trick their users. This can not be compared to cases where someone hides various keywords that are not repeated in or relevant to the content.
However, that doesn't mean that you should do it.
I don't know why I do it, I've always done it.
Now is the time to rethink it. Why would you do something like that at all? The logo is (or represents) the name/title of the site. So it should be in
h1. Depending on your hiding method, the heading might be hidden for screenreaders, too (which could break the outline navigation many screenreader users use).
If you want to
display provide both, logo and name, you can put them both in the same
h1, or you could use the HTML5
<!-- variant 1 -->
<h1><img src="acme-logo.png" alt="" />ACME Inc.</h1>
<!-- variant 2 -->
<h1><img src="acme-logo.png" alt="" /></h1>
Note that the
alt attribute value should be empty here:
alt attribute's value should not repeat information that is already provided in the prose next to the image
If you want to only use the logo, it's fine too:
<h1><img src="acme-logo.png" alt="ACME Inc." /></h1>
Regarding the other answers:
It's totally fine and good and in many cases even required (for the outline of the document) to use
h1 for the site title, not for the page content title. In HTML5 you can use
h1 for both titles, though (in combination with sectioning elements).
A CSS image-replacement method should not be used for the site logo, as it is content (HTML), not decoration (CSS)