How to convert a .txt file to any image format

11 ビュー (過去 30 日間)
Aravind Poolla
Aravind Poolla 2020 年 12 月 15 日
コメント済み: Jan 2020 年 12 月 23 日
I have a .txt file which contains the data of image in numbers as I am new to matlab I need some help figuring this out .
All i need is to convert this .txt file into any image format like a jpeg,jpg or anything. I tried attaching the file but after reducing it is 6mb so this site is not accepting it but i added a screenshot of it below . If you are intrested in this I can email you the file afer looking into the screenshot.
Thank you in advance

回答 (1 件)

Jan
Jan 2020 年 12 月 15 日
The contents of the file does not contain enouh information to understand the format completely. The initial "2 2 1 1" might be important or not. Without knowing, what these values mean, it is impossible to create an image, which displays exactly, what is written to the text file.
So the frist step ist to find a documentation of the file format. Then It should be more or less easy to write a code for the conversion.
  6 件のコメント
Aravind Poolla
Aravind Poolla 2020 年 12 月 22 日
I am sharing a link for the file, if you scroll down 750 lines you can see x,y values. I think those values are pixels.
Jan
Jan 2020 年 12 月 23 日
The values could be positions of pixels, or RGB values of pixels on a grid, or difference to the former pixel, or something else. Guessing is not reliable. Why don't you ask the author of the software, which has created the file? Asking authors is the standard method to obtain information.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConvert Image Type についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by