IPic is a small site I made. More like a simple, free tracking service.
Whenever you visit it, it will provide two unique links. The first one is a link to a 1 transparent pixel PNG which you can include in any HTML or BBcode you want. The second link will show you the IP of whoever viewed that picture in the past 30 days. I had some minor problems and it deleted visits after 4 days from the statistics page (instead of 30) but I think it's be OK now.
As for the legality of the site, I don't think it's illegal, Statcounter provides the same service by using javascript but in any case it's up to use to decide whether and where to use it so do it wisely.
Finally if you don't like the huge advertisement that appears on every page just install Adblock.
Visit IPic.