What is the use of this practice today?
Portability. In some cases you need to ensure that the feature will be available in any situation: If your HTML content is being generated dynamically in offline mode, without internet access or operating in a protocol (HTTPS for example) that does not allow you to access resources in hybrid mode.
An example are the Chrome Urls, where all the images present are Base64:
Test some of these Urls in Chrome:
Chrome://ipc
Chrome://Inspect
Chrome://media-Internals
Chrome://memory
Is there any gain in performance compared to
store/transmit binary data in its original formats (in this
case, bitmap)?
In practice, the difference is negligible. Once your content is cached, it is handled in the same way by modern browsers, whether its origin is a response to a GET
or interpretation of content inline Base64.
(It is worth mentioning that if you are embedding Base64 content into a dynamically generated page you will be resending the content to each request.)
When stored locally, we should use bitmap or string
Base64?
If by locally you mean the browser, there is no reason to worry about it.
If you mean the server, it depends on your implementation strategy; remember that all change of the atomic file (containing HTML/CSS + Base64) will imply a cache flush/refresh.
When is it good practice to use bitmap? And string Base64?
The most used binary formats (JPEG, PNG) use fewer bytes than a Base64 string, but this difference is only felt in an access with the cache still empty.
If you’re storing one large amount of images or just viewing a small collection set, use binary files.
If your application uses few bitmap graphics or needs to run in offline mode, Base64.