In MATLAB you can easily convert your image from a specific format to another format in the following list:
bmp, gif, hdf, jpg, jpeg, jp2, jpx, pbm, pgm, ppm, pnm, pcx, png, ras, tif, tiff, xwd.
Although here I mention some examples, you can convert anything mentioned in the above list easily in 2 lines of code.
first of all you need to read the image file:
I = imread('myImage.png');
here I assume that I have an image with png format, but you can have other formats as well.
The next step is, convert it to your desired format and write it:
imwrite(I,'myImage2.bmp'); imwrite(I,'myImage3.gif'); imwrite(I,'myImage4.hdf'); imwrite(I,'myImage5.jpg'); imwrite(I,'myImage6.bpm'); imwrite(I,'myImage7.pgm'); imwrite(I,'myImage8.ppm'); imwrite(I,'myImage9.tiff');
For more details check the MATLAB document page.
Is it possible to change image format without writing on disk?
but what’s the problem in my matlab it can’t covert image jpg to ppm