Images can be displayed in a webpage using the 'img' tag as follows:
<img src="some-url" width=300 height=400>
Following image can be displayed using:
<img src="PS2.PNG" width=180 height=120>
Encoding image as base64 into the html code
Any kind of data can be encoded in base-64 to give an ascii output.
Image can be converted into base-64 ascii format by using some online tool such as this one.
The output ascii can be used as follows:
Advantage of doing so is that the image data need not be fetched from a different URL.
However, an issue with this approach is that the size of the HTML page becomes quite big.
Also, base-64 encoding usually blows up the size of the original image, so the overall loading time of the page is increased.
To summarize, create base64 encoding only when the image is small enough so that around 30% increase in image size would be of no consequence.
Do not use this approach if the image is very large (Example: more than 100kb)
|Email:||(Your email is not shared with anybody)|