D
D
Dmitry Usatiy2015-05-21 06:34:26
Programming
Dmitry Usatiy, 2015-05-21 06:34:26

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.

  • Is it possible to do this?
  • If yes, with what programs?

Also interested in: extracting binary code from a binary image, formats used, color models.
Thanks in advance. I apologize that the question may be incorrect. I am new to this topic.
Example:
78772c120ff74e9892e3403866095e97.png

Answer the question

In order to leave comments, you need to log in

3 answer(s)
V
Vladimir Martyanov, 2015-05-21
@vilgeforce

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.

V
Vitaly Pukhov, 2015-05-21
@Neuroware

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.

P
polar_winter, 2015-05-21
@polar_winter

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 question

Ask a Question

731 491 924 answers to any question