How can i imwrite ppm image file as a ASCII Encoding format
4 ビュー (過去 30 日間)
古いコメントを表示
After reading the PPM file and processing the data, and save it again using imwrite.
But I cant imwrite ppm image file as a ASCII Encoding format
So I cant properly using that ppm file.
For example,
a = imread("xxxx.ppm")
Iinfo1 = imfinfo('xxxx.ppm')
That file's FormatVersion : 'P3', Formatsignature : 'P3' and Encoding:'ASCII'
but after processing 'a' data, and store parameter 'b'
imwrite(b,'yyyy.ppm')
and Iinfo2 = imfinfo('yyyy.ppm')
That file's FormatVerison : 'P6', Formatsignature : 'P6' and Encoding:'rawbits'
I want imwrite .ppm file as a ASCII Encoding format
please help me.
I can't find any solution on the Internet
I'm sorry for the lack of readability because My English skill are not good
Thanks for reading.
0 件のコメント
採用された回答
Angelo Yeo
2024 年 4 月 3 日
a = imread("sample.ppm");
imwrite(a, "save_sample.ppm","ppm", "Encoding","ASCII")
imginfo = imfinfo("save_sample.ppm")
imginfo =
Filename: 'C:\Workspace\q2102176\save_sample.ppm'
FileModDate: '03-Apr-2024 15:37:25'
FileSize: 2800776
Format: 'PPM'
FormatVersion: 'P3'
Width: 640
Height: 426
BitDepth: 24
ColorType: 'truecolor'
FormatSignature: 'P3'
Encoding: 'ASCII'
MaxValue: 255
ImageDataOffset: 15
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Standard File Formats についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!