Conversion of 100 jpg images to PGM
4 ビュー (過去 30 日間)
古いコメントを表示
Kindly how can we convert 100 images which are jpg to PGM format?
the Matlab code for one image conversion is:
I = imread('myImage.jpg'); imwrite(I,'myImage7.pgm');
then if we have 100 jpg images how we can convert them to pgm format?
0 件のコメント
採用された回答
Image Analyst
2018 年 10 月 1 日
Use the second code sample block.
7 件のコメント
Guillaume
2018 年 10 月 3 日
Seriously, use a better image viewer, one that includes batch format conversion. A few were already suggested. You would have solved your problem in a matter of minutes.
Image Analyst
2018 年 10 月 3 日
I don't know what "opensleeit" is.
When you run the program, imshow() shows/displays each image as it's loaded. Are you saying imshow() does not work for you?
Why do you want PGM format images anyway? Isn't that some obsolete format from the 90's? Why not just leave them as they are, or use PNG format, which has become the defacto standard?
Since the images have already been ruined by saving in JPG format, converting to another format won't gain you anything. Plus nearly every program that "sees" PGM images will also see JPG images.
その他の回答 (3 件)
John D'Errico
2018 年 10 月 1 日
Use a loop? Surely you can get the directory contents, so the names of all images in a directory, using a tool like dir. Now just loop over the images that dir returns.
Guillaume
2018 年 10 月 2 日
Even simpler, particularly if you don't have the knowledge to write the code is to download any decent image viewer program that will surely include batch image conversion as one of its feature.
My favorite, which is free for personal and academic use is IrfanView. Start the program, press B (for batch conversion), select the images to convert, select PGM in output format, Press Start Batch. Done!
2 件のコメント
Guillaume
2018 年 10 月 2 日
ACDSee is still around! I remember using that in the 90s. There's also XnView which is also free and probably many more that can do this in a few clicks. And if you prefer command line, there's always ImageMagick, which again, can do the job in just one command.
The point is, you don't always have to use matlab to solve your problems.
kalai selvi
2020 年 9 月 19 日
how to convert the scatter plot fig into pgm
1 件のコメント
Image Analyst
2020 年 9 月 19 日
参考
カテゴリ
Help Center および File Exchange で Environment and Settings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!