Answer the question
In order to leave comments, you need to log in
How to convert a binary array to an image with given dimensions?
Good day. I came across a question about converting a binary code to a binary image by fixed sizes.
Answer the question
In order to leave comments, you need to log in
Get the height and width of the image. Then, in nested loops for height and width, read the color value from the image and draw a point of the corresponding color in coordinates corresponding to the loop counters.
As a result, the functions for obtaining the size and color of a pixel depend on the image format.
In general, the task is elementary (see the answer of @vilgeforce), but if you need a ready-made program that does what you described, then it is unlikely that there is one, because by itself, no one usually needs it separately. If necessary, I can pull out a piece from one of my programs, which does exactly what is described and arrange it as a "separate program". The only question is what will be the input format and what output format do you need.
Well, matlab works with this question and related ones. (Matlab. Image processing toolbox.) Almost any matrix can be displayed as an image, with one command line.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question