Re: Writing several images into a single binary file



Giff wrote:
I have been successfully writing and reading images to/from binary files just with the image size on the first row and then all the pixel values sequentially, through the read/write functions (I use C++).

Now, I would like to join few images in a single file, separating the single images from each other by a text comment.

There is no way this can ever possibly work reliably. The pixel data
is arbitrary data and can include any arbitrary sequence of bytes.

What would be your suggestion to solve this problem?

I would use a library that already knows how to read and write a standard
image format.

But if for some reason you have a compelling reason to invent your own
format, you are already storing the width in pixels of the first image,
so based on that data, you should be able to compute the offset to
the next image without relying on an inherently unreliable method like
looking for newlines.

- Logan
.



Relevant Pages

  • Re: Wrong patient orientation in a mammo image? - fuji-problem.txt (1/1)
    ... One cannot answer this question without seeing the pixel ... Referenced Study Sequence: ... Private Creator Data Element: ...
    (comp.protocols.dicom)
  • Re: Cohens paper on byte order
    ... > pertain specifically to the order within the input/ ... > output bit sequence. ... Do you mean by 'index' the first row of Fig. 2? ... the value of AES indices had some inherent meaning ...
    (sci.crypt)
  • Re: Unexpected nulls in combo box
    ... The first row in the select has a 1 in the sequence column when it ... Whenever this retrieves a result set where the first row has an empty ... is_PreviousDescription is set to txtDescription. ...
    (microsoft.public.access.formscoding)
  • Re: image getting flipped by 180 degree
    ... wxImage's GetData() method returns the pixel data into top-to-bottom ... pixel of the first row, the second one --- to the second pixel of the ...
    (comp.graphics.api.opengl)
  • Re: how do I quickly insert numbers 1 to 100 in a column in Excel?
    ... - all rows are to be numbered in sequence 1 to 100,,,. ... type "1" in this cell at the first row, then drag down to the last ... from the bottom right corner handle of the first cell. ...
    (microsoft.public.excel.misc)