comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: tiff to eps
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: tiff to eps [message #53651] Fri, 27 April 2007 07:23
Carsten Lechte is currently offline  Carsten Lechte
Messages: 124
Registered: August 2006
Senior Member
Mike Chinander wrote:
> prompt> ls -l rose.eps
> -rw-r--r-- 1 user group 8272 Apr 26 14:18 rose.eps
>
> Only 8272 bytes.

And that is mostly caused by the overhead of coding binary data into
printable characters.


chl
Re: tiff to eps [message #53662 is a reply to message #53651] Thu, 26 April 2007 12:19 Go to previous message
mchinand is currently offline  mchinand
Messages: 66
Registered: September 1996
Member
In article <1S6Yh.6$25.138@news.uchicago.edu>,
Mike Chinander <mchinand@midway.uchicago.edu> wrote:
> In article <MPG.209ab4667a64d0a0989f62@news.frii.com>,
> David Fanning <news@dfanning.com> wrote:
>> David Fanning writes:
>>
>>> I would guess it depends entirely on how big you want
>>> the PostScript image to be. Why don't you try it and
>>> see? It is only a couple of commands:
>>>
>>> Read_JPEG, filename, image
>>> Set_Plot, 'PS'
>>> Device, /color, bits=8, /encap, xsize=5, ysize=3.5, /inches
>>> TVImge, image
>>> Device, /Close
>>
>> Well, lots of good non-IDL solutions. But in my little
>> test, using the rose.jpg file from the IDL distribution.
>> I got a file that weighed in at a hefty 204 KBytes. :-)
>>
>
> Considering that rose.jpg is only 5756 bytes, that's quite an increase.
>
> prompt> ls -l rose.jpg
> -rw-r--r-- 1 xfs users 5756 Jun 29 2005 rose.jpg

Forgot to include the comparison to using jpeg2ps

prompt> jpeg2ps /usr/local/packages/rsi/idl_6.2_i586/examples/data/rose.jpg > rose.eps
Note on file '/usr/local/packages/rsi/idl_6.2_i586/examples/data/rose.jpg ': 227x149 pixel, 3 color
components

prompt> ls -l rose.eps
-rw-r--r-- 1 user group 8272 Apr 26 14:18 rose.eps

Only 8272 bytes.

--Mike
Re: tiff to eps [message #53664 is a reply to message #53662] Thu, 26 April 2007 12:14 Go to previous message
mchinand is currently offline  mchinand
Messages: 66
Registered: September 1996
Member
In article <MPG.209ab4667a64d0a0989f62@news.frii.com>,
David Fanning <news@dfanning.com> wrote:
> David Fanning writes:
>
>> I would guess it depends entirely on how big you want
>> the PostScript image to be. Why don't you try it and
>> see? It is only a couple of commands:
>>
>> Read_JPEG, filename, image
>> Set_Plot, 'PS'
>> Device, /color, bits=8, /encap, xsize=5, ysize=3.5, /inches
>> TVImge, image
>> Device, /Close
>
> Well, lots of good non-IDL solutions. But in my little
> test, using the rose.jpg file from the IDL distribution.
> I got a file that weighed in at a hefty 204 KBytes. :-)
>

Considering that rose.jpg is only 5756 bytes, that's quite an increase.

prompt> ls -l rose.jpg
-rw-r--r-- 1 xfs users 5756 Jun 29 2005 rose.jpg
Re: tiff to eps [message #53665 is a reply to message #53664] Thu, 26 April 2007 13:07 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
David Fanning writes:

> I would guess it depends entirely on how big you want
> the PostScript image to be. Why don't you try it and
> see? It is only a couple of commands:
>
> Read_JPEG, filename, image
> Set_Plot, 'PS'
> Device, /color, bits=8, /encap, xsize=5, ysize=3.5, /inches
> TVImge, image
> Device, /Close

Well, lots of good non-IDL solutions. But in my little
test, using the rose.jpg file from the IDL distribution.
I got a file that weighed in at a hefty 204 KBytes. :-)

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
Re: tiff to eps [message #53666 is a reply to message #53664] Thu, 26 April 2007 11:55 Go to previous message
mchinand is currently offline  mchinand
Messages: 66
Registered: September 1996
Member
In article <Pine.LNX.4.64.0704261944020.5885@bifur.rmki.kfki.hu>,
F�LDY Lajos <foldy@rmki.kfki.hu> wrote:
>
> On Thu, 26 Apr 2007, ebertf@gmx.de wrote:
>
>> Hi,
>> is there a simple way to convert a tiff or Jpg Picture into encapsuled
>> postscript using IDL without blowing up the size (1MB -> 20 MB That
>> usually happens when using Corel Draw). I want to include the
>> postscript into Latex Code. ( For example a fotograph.)
>> Thanks for ideas!
>> Regards
>> Florian
>>
>
> You can use pdflatex, which can include JPEG images natively.
>

There's also jpeg2ps which just wraps the jpeg image data w/ the necessary Postscript without
uncompressing the image.

http://www.pdflib.com/download/free-software/jpeg2ps/

--
Michael Chinander
m-chinander@uchicago.edu
Department of Radiology
University of Chicago
Re: tiff to eps [message #53667 is a reply to message #53666] Thu, 26 April 2007 10:49 Go to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Thu, 26 Apr 2007, ebertf@gmx.de wrote:

> Hi,
> is there a simple way to convert a tiff or Jpg Picture into encapsuled
> postscript using IDL without blowing up the size (1MB -> 20 MB That
> usually happens when using Corel Draw). I want to include the
> postscript into Latex Code. ( For example a fotograph.)
> Thanks for ideas!
> Regards
> Florian
>

You can use pdflatex, which can include JPEG images natively.

regards,
lajos
Re: tiff to eps [message #53668 is a reply to message #53667] Thu, 26 April 2007 10:31 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Thu, 26 Apr 2007 09:56:11 -0700, ebertf wrote:

> Hi,
> is there a simple way to convert a tiff or Jpg Picture into encapsuled
> postscript using IDL without blowing up the size (1MB -> 20 MB That
> usually happens when using Corel Draw). I want to include the
> postscript into Latex Code. ( For example a fotograph.)

The problem is most conversion tools put raw uncompressed data in the
postscript file, which is a big waste (but was the only way to do it
in PS level 1). Others are better, e.g. tiff2ps from the libtiff
library, or imgtops. Arxiv.org gives some recommendations for
avoiding the "bloat":

http://arxiv.org/help/bitmap/software#imgtops

I believe Level 2 postscript can wrap compressed JPEG data directly.

http://imgtops.sourceforge.net/

has more info.

JD
Re: tiff to eps [message #53669 is a reply to message #53668] Thu, 26 April 2007 10:28 Go to previous message
Jo Klein is currently offline  Jo Klein
Messages: 54
Registered: January 2006
Member
Hi Florian,
Postscript isn't a good format for raster data. It only has limited
support for data compression. In Level 2, LZW compression can be used,
but this is not implemented by many converters (due to now obsolete
patent issues, amongst other reasons). Thus, file size will usually
increase significantly when you convert from lossy formats, such as jpg.
You can try free converters, such as imconv and convert, to see if they
produce smaller PS files, I'm not sure if any of those support compression.
Hope this helps,
Jo
Re: tiff to eps [message #53670 is a reply to message #53669] Thu, 26 April 2007 11:17 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
ebertf@gmx.de writes:

> is there a simple way to convert a tiff or Jpg Picture into encapsuled
> postscript using IDL without blowing up the size (1MB -> 20 MB That
> usually happens when using Corel Draw). I want to include the
> postscript into Latex Code. ( For example a fotograph.)

I would guess it depends entirely on how big you want
the PostScript image to be. Why don't you try it and
see? It is only a couple of commands:

Read_JPEG, filename, image
Set_Plot, 'PS'
Device, /color, bits=8, /encap, xsize=5, ysize=3.5, /inches
TVImge, image
Device, /Close

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Ubuntu Feisty and IDL
Next Topic: Antes de FAC Club

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 15:14:05 PDT 2025

Total time taken to generate the page: 0.00768 seconds