How to convert BMP picture to jpeg ?

I have bmp picture
I want to write code for convert type of picture to jpeg file

how to ?

Open the picture. Then save it as type BMP. See Picture.Save in the documentation for specifics.

What a strange idea to save it as jpg. Why not using the free all purpose png ?