octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [CHANGESET] updated print.m


From: Ben Abbott
Subject: Re: [CHANGESET] updated print.m
Date: Wed, 22 Apr 2009 19:08:31 -0400

On Apr 21, 2009, at 7:11 AM, Ben Abbott wrote:

On Apr 20, 2009, at 11:36 PM, Shai Ayal wrote:

On Tue, Apr 21, 2009 at 4:07 AM, Ben Abbott <address@hidden> wrote:
I noticed that converting an eps-file to a bitmap does not give the same
result as printing a bitmap.

This is a because gnuplot's ps terminal does not produce the same
output as it's jpeg terminal, it's not a fault of gs. I generally find
gnuplot's ps terminal to be th most complete, so I always use it, and
convert to pdf/png/jpeg as necessary.

For me, the ps and eps output have different font sizes. The ps result is correct. I'll do as you suggest and use it.


Consider the example ...

      figure (1)
      clf
      plot (1:10)
      set (gca, "fontsize", 12)
      xlabel ("my xlabel")
      ylabel ("my ylabel")
      title ("my title")
      print (gcf, "-djpeg", "test.jpeg")
      print (gcf, "-deps", "test.eps")
system ("gs -r150 -sDEVICE=jpeg -sOutputFile=test_gs.jpeg - dEPSCrop
-dBATCH test.eps")

The quality of the converted jpeg is degraded and the fontsize is different. If the fontsize is increased by 50%, then the proper size is obtained (I may
be off by a point or two).

I would recommend the following gs command line to convert from eps:

sprintf("gs -r%s -q -dBATCH -dEPSCrop -dSAFER -dNOPAUSE
-dTextAlphaBits=4 -sDEVICE=%s -sOutputFile=\"%s\" \"%s\"", res , dev,
outfile, infile);

BTW,  I would not recommend using jpeg for graphs -- jpeg's lossy
compression algorithm is really geared towards compressing photos, and
degrades the picture in a very noticeable way for graphs. I would use
png which has lossless compression and compresses graphs very well.

Shai

Thanks Shai! I'll do as you suggest.

Ben


I've made the switch from ImageMagick's "convert" to Ghostscript. In addition, support for Windows printing has been added (I don't have access to a box to test this change, so some assistance would be helpful), and improved printing on Unix systems. The "help" has been modified to reflect the changes.

I'll delay pushing to give time for testing. If I get no feedback in the next day or two, I'll push this change.

Ben

Attachment: changeset-print_using_gs.patch
Description: Binary data






reply via email to

[Prev in Thread] Current Thread [Next in Thread]