I don't think you can use XmlHttpRequest for that. It returns either text or XML. You can encode binary data as text, but then your client-side JavaScript probably couldn't do anything useful with it.
However, if what you are trying to do is to dynamically update images, you do not need to send the image in this way.
If the IMG element is already part of the displayed HTML document, you can find it in the DOM and change its "src" attribute. This will cause the client to request the new binary image data from the server. That will be a background request which will not make the whole page refresh.
If you are wanting to add a new IMG to the displayed HTML document, you can add a new IMG element using DOM API and set its "src" appropriately. Again, this will cause the browser to request the binary image data from the server.
This assumes that you have a
servlet or similar on the server that can handle the requests for binary image data.