Initialize Adobe Photoshop by double-clicking its icon.
Once opened, create or import the desired image.
Ensure that the background layer is set to transparent.
Once you are done with the image creation process, flatten the image by going toLayer > Flatten Image.
Accept any confirmation that is displayed in any kind of confirmation box while flattening the image.
Once the images are flattened, go to File menu from the menu bar.
From the displayed menu, click the Save for Web option.
(Note: Adobe Photoshop 7 is used for this demonstration. If you have some other version of Adobe Photoshop, you might find Save for Web and Devices option or something similar to this in the File menu.)
Check the Transparency checkbox.
Finally click the Save button to save the image with the transparent background.
The saved image can now be used for webpages as it does not contain any white or black background whatsoever.