Discussion:
Text image to JPEG
Waldir Leite Roque
2014-09-12 12:47:54 UTC
Permalink
I have a sequence of text binary images (matrix of 0 and 1) and I would
like to convert them to JPG or Tif, etc, but I could not find the way using
ImageJ. Can anyone help me with this task?

Thank you.

Waldir
--
Dr. Waldir Leite Roque
Prof. Associado IV
Programa de Pós-Graduação em Modelagem Matemática e Computacional
Departamento de Computação Científica
Centro de Informática
Universidade Federal da Paraíba
58051-900 João Pessoa, PB
roque-NCC6fJ1QJGNfyO9Q7EP/***@public.gmane.org

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Herbie
2014-09-12 13:36:02 UTC
Permalink
Waldir,

did you have a look at the ImageJ-Manual?

<rsb.info.nih.gov/ij/docs/guide/user-guide.pdf>

Although it doesn't cover the latest development it helps in your case.

Have a look at the "Import Text Image"- and "Batch Processing"-section.
The latter is quite convenient for format conversions.

There is no sense to convert a binary image to JEPG because the
JEPG-compression isn't made for binary images. Use the PNG-format
(lossless compression) instead or simply zipped TIFF (lossless but less
compressed) if you need compressed images. TIFF per se is OK if
compression isn't required.

HTH

Herbie
Post by Waldir Leite Roque
I have a sequence of text binary images (matrix of 0 and 1) and I would
like to convert them to JPG or Tif, etc, but I could not find the way using
ImageJ. Can anyone help me with this task?
Thank you.
Waldir
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Waldir Leite Roque
2014-09-12 14:00:11 UTC
Permalink
Thanks Herbie and Jerome,

I think I did not state the question appropriately. In fact, I have a
binary matrix (text file not a text image) that I can load in ImageJ using
Import>Text file. Now I would like to convert it to an image file (any
format). Perhaps there is a plugin to do so, but I could not find one.
Thanks again.

Waldir
Post by Herbie
Waldir,
did you have a look at the ImageJ-Manual?
<rsb.info.nih.gov/ij/docs/guide/user-guide.pdf>
Although it doesn't cover the latest development it helps in your case.
Have a look at the "Import Text Image"- and "Batch Processing"-section.
The latter is quite convenient for format conversions.
There is no sense to convert a binary image to JEPG because the
JEPG-compression isn't made for binary images. Use the PNG-format (lossless
compression) instead or simply zipped TIFF (lossless but less compressed)
if you need compressed images. TIFF per se is OK if compression isn't
required.
HTH
Herbie
Post by Waldir Leite Roque
I have a sequence of text binary images (matrix of 0 and 1) and I would
like to convert them to JPG or Tif, etc, but I could not find the way using
ImageJ. Can anyone help me with this task?
Thank you.
Waldir
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
--
Dr. Waldir Leite Roque
Prof. Associado IV
Programa de Pós-Graduação em Modelagem Matemática e Computacional
Departamento de Computação Científica
Centro de Informática
Universidade Federal da Paraíba
58051-900 João Pessoa, PB
roque-NCC6fJ1QJGNfyO9Q7EP/***@public.gmane.org

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Gabriel Landini
2014-09-12 14:15:15 UTC
Permalink
In fact, I have a binary matrix (text file not a text image) that I can load
in ImageJ using Import>Text file.
No, "File >Import > Text Image" is what was suggested.

Cheers

Gabriel

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Herbie
2014-09-12 15:06:13 UTC
Permalink
Waldir,

a text file is imported as readable text, a text image consisting of an
array of numbers is imported as an image. The respective import options
are "Import > Text File" and "Import > Text Image".

Gabriel thanks for the confirmation!

Best

Herbie
Post by Waldir Leite Roque
Thanks Herbie and Jerome,
I think I did not state the question appropriately. In fact, I have a
binary matrix (text file not a text image) that I can load in ImageJ using
Import>Text file. Now I would like to convert it to an image file (any
format). Perhaps there is a plugin to do so, but I could not find one.
Thanks again.
Waldir
Post by Herbie
Waldir,
did you have a look at the ImageJ-Manual?
<rsb.info.nih.gov/ij/docs/guide/user-guide.pdf>
Although it doesn't cover the latest development it helps in your case.
Have a look at the "Import Text Image"- and "Batch Processing"-section.
The latter is quite convenient for format conversions.
There is no sense to convert a binary image to JEPG because the
JEPG-compression isn't made for binary images. Use the PNG-format (lossless
compression) instead or simply zipped TIFF (lossless but less compressed)
if you need compressed images. TIFF per se is OK if compression isn't
required.
HTH
Herbie
Post by Waldir Leite Roque
I have a sequence of text binary images (matrix of 0 and 1) and I would
like to convert them to JPG or Tif, etc, but I could not find the way using
ImageJ. Can anyone help me with this task?
Thank you.
Waldir
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html

Jerome Mutterer
2014-09-12 13:41:09 UTC
Permalink
Hi,
You can use the File >Import > Text Image... command to import your binary
matrix, and then save the result image using File > Save As > Jpeg... or
File > Save As > Tiff... commands.
Do this with the command recorder activated, and see the recorded macro
statements.
They will look like this :

run("Text Image... ", "open=/Users/jmutterer/Desktop/binary.txt");

saveAs("Tiff", "/Users/jmutterer/Desktop/binary.tif");


You can use these to modify the example
http://rsb.info.nih.gov/ij/macros/BatchProcessFolders.txt macro to
sequentially import and save your images. In the latter macro, modify
the processFile(path)
function so that it looks like this :

function processFile(path) {
run("Text Image... ", "open=["+path+"]");
saveAs("Tiff", path);
close();
}


Jerome
Post by Waldir Leite Roque
I have a sequence of text binary images (matrix of 0 and 1) and I would
like to convert them to JPG or Tif, etc, but I could not find the way using
ImageJ. Can anyone help me with this task?
Thank you.
Waldir
--
Dr. Waldir Leite Roque
Prof. Associado IV
Programa de Pós-Graduação em Modelagem Matemática e Computacional
Departamento de Computação Científica
Centro de Informática
Universidade Federal da Paraíba
58051-900 João Pessoa, PB
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
--
Jerome Mutterer
CNRS - Institut de biologie moléculaire des plantes
12, rue du Général Zimmer
67084 Strasbourg Cedex
T 0367155339
www.ibmp.cnrs.fr

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Continue reading on narkive:
Loading...