Your PHP code should be able to access protected directories ITSELF, but the web browser will not.
When you produce an inline image element, it's the web browser which fetches the image, not the php.
Therefore, normal restrictions apply.
Things which read the file server side, such as include() require() etc, and file IO such as fopen(), will be unaffected by .htaccess
Mark