Text image to JPEG

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Text image to JPEG

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
[hidden email]

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Text image to JPEG

Herbie-4
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

::::::::::::::::::::::::::::::::::::::::::::
On 12.09.14 14:47, Waldir Leite Roque wrote:
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Text image to JPEG

Jerome Mutterer-3
In reply to this post by Waldir Leite Roque
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


On 12 September 2014 14:47, Waldir Leite Roque <[hidden email]> wrote:

> 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
> [hidden email]
>
> --
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Text image to JPEG

Waldir Leite Roque
In reply to this post by Herbie-4
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

2014-09-12 10:36 GMT-03:00 Herbie <[hidden email]>:

> 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
>
> ::::::::::::::::::::::::::::::::::::::::::::
> On 12.09.14 14:47, Waldir Leite Roque wrote:
>
>> 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
[hidden email]

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: Text image to JPEG

Gabriel Landini
On Friday 12 Sep 2014 11:00:11 Waldir Leite Roque wrote:
> 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
Reply | Threaded
Open this post in threaded view
|

Re: Text image to JPEG

Herbie-4
In reply to this post by Waldir Leite Roque
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

::::::::::::::::::::::::::::::::::::::::::::
On 12.09.14 16:00, Waldir Leite Roque wrote:

> 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
>
> 2014-09-12 10:36 GMT-03:00 Herbie <[hidden email]>:
>
>> 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
>>
>> ::::::::::::::::::::::::::::::::::::::::::::
>> On 12.09.14 14:47, Waldir Leite Roque wrote:
>>
>>> 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
Reply | Threaded
Open this post in threaded view
|

Re: Text image to JPEG

arronlee
Hi, Waldir.    
Thanks for your nice sharing. As for me, I have seldom tried to deal with that. It is of great help. I wonder whether you have any exprience about pdf conversion process. Because there is something wrong with my pdf reader. I need convert pdf to text or other formats. Any suggestion will be appreciated. Thanks in advance.        



Lee