[SOLVED] How can I create a png or jpeg file programatically ?
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
How can I create a png or jpeg file programatically ?
Hello,
Given a matrix with 0,1 entries, how can I create a graphic in linux such that we have a black square or pixel if the entry is one and white otherwise?
For example, if the matrix is:
0001000
0011100
0111110
0000000
then I want a graphic that looks like:
███████
███████
███████
███████
I will be working with many large matrices, e.g. 1000x1000, or 5000x1000 so I need to do this automatically.
Depends on the programming language you want to use. And if you know that, the answer is only one "googling" away.
I know how to do it using software, e.g. matlab, maple, mathematica, etc. I "googled" it and all I found was that type of software. But preferable I would like to use only a sh file.
Anyone has any idea besides telling me to go google it ?
When looking for xpm, I found pbm and it is the best option for my needs.
The format would be
P1
7 4
0001000
0011100
0111110
0000000
and then I would save it as pbm, that's it. It would directly handle the matrix. This can easily be done with a sh file (I would just need to add P1 and the size of the matrix).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.