[Thread Prev][Thread Next][Index]

Re: [ferret_users] Generating nice PS file, problem with margins



Hi Szymon ,
Yes, this is an issue with aliasing in the graphics. It's something that is much improved in PyFerret, as PyFerret uses different underlying graphics engines that give us more control over this. For more information, see here:

http://ferret.pmel.noaa.gov/Ferret/documentation/pyferret
http://ferret.pmel.noaa.gov/Ferret/documentation/pyferret/graphics/

(Because pyFerret is currently a beta release, the commands that control the graphics settings are still under discussion and will probably change in future releases)

There are workarounds for this in standard Ferret. One very good one is to draw a SHADE plot and then overlay it with a FILL plot using the same color levels.  I've attached two plots - one with FILL only and the other with FILL overlaid on a SHADE.
yes? use monthly_navy_winds
yes? shade/L=55 uwnd
yes? fill/L=55/over/nolab/lev uwnd
Other suggestions have been made in the email archives. Find discussions by searching for "white lines".  For instance here are two threads which talk about this:

http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2011/msg00034.html
http://www.pmel.noaa.gov/maillists/tmap/ferret_users/fu_2010/msg00632.html

and I would say that your suggestion about applying antialiasing using gs is another good idea.

Ansley

                                                              
On 1/28/2013 7:31 AM, Szymon Roziewski wrote:
Hi there!


I 'm experiencing such an issue genereting graphics.

Mainly, I have got 2 narrows line in the picture.

I have no idea how to get rid off these.

I attach necessary files, if someone may help I would appreciate and be really grateful.

The command that I use.

gs -q -dNOPAUSE -dBATCH -sDEVICE=pnmraw -r150x150 -dTextAlphaBits=2 -dGraphicsAlphaBits=2 -sOutputFile=- file_name.ps | pnmflip -r90 | convert -antialias - file_name.png


All the best,
Szymon Rozieski


On 29 August 2012 22:59, Ryo Furue <furue@xxxxxxxxxx> wrote:
Hi Szymon,

> When I switched off the options -dTextAlphaBits=4 -dGraphicsAlphaBits=4
> This leads to fonts are drawn only with 1 color.
>
> So, using options *-dTextAlphaBits=2 -dGraphicsAlphaBits=2*
> was better, I got slightly differential colors (in gray scale) in fonts.

You seem to mean that you need smoother letterings (numbers and
alphabet characters).  Is that right?

In that case, I can think of three solutions:

1)  Search the Ferret mailing list archive for "antialias".  I
 remember somebody posted a script that alleviate the problem
 of the thin lines (by thickening border lines?).

2)  Edit the PostScript file with a PostScript editor such as Inkscape
 and Illustrator to replace the letterings with real text(*footnote);
 and convert the resultant PostScript file with TextAlphaBits but
 without GraphicsAlphaBits .  In that way, you'll get smoother
 text without introducing aliasing into the graphics part.

3) Thicken the fonts in Ferret.  In that way, they look fine (to me)
 without smoothing by AlphaBits (antialiasing).

I normally do (3).

Regards,
Ryo
----
(*footnote)  Ferret's fonts are sets of lines, of not text characters.
Therefore, they are treat as (and they actually are) line graphics.


>
> Thank you very much,
>
> Kind regards,
> Szymon Roziewski
>
>
> On 29 August 2012 00:05, Ryo Furue <furue@xxxxxxxxxx> wrote:
>
>> Dear Szymon,
>>
>> > *gs -q -dNOPAUSE -dBATCH -sDEVICE=pnmraw -r150x150 -dTextAlphaBits=4
>> > -dGraphicsAlphaBits=4 -sOutputFile=- polycstline.ps | pnmflip -r90 |
>> > convert +antialias - polycstline.png*
>> >
>> > I changed line thickness and now I am quite happy about this wthat I
>> have.
>> >
>> > Mainly, I have this bluish lines on the plot and no idea of how I can get
>> > rid off it.
>>
>> Those thin lines are due to antialiasing.  In the above, you first
>> convert the PostScript file to a raster image using gs and finally
>> convert it to another raster format, PNG.  I'm not familiar with
>> details of gs, but it must be performing the conversion with
>> antialising. . . . Hmm, but it seems GraphicsAlphaBits and
>> TextAlphaBits are the antialising operations here.  What happens if
>> you don't use those options?
>>
>> (You switch off antialiasing for your "convert" command, but it's too
>>  late.)
>>
>> Better still, the "convert" command can manipulate your image in a
>> lot of ways and you may not need to use "gs" in the first place:
>>
>>  convert -density 150 -rotate 90 +antialias polycstline.ps polycstline.png
>>
>> or something along the lines.
>>
>> Regards,
>> Ryo
>>
>
>
>
> --
> Z wyrazami szacunku,
> Szymon Roziewski



--
Z wyrazami szacunku,
Szymon Roziewski

Attachment: fill_only.ps
Description: PostScript document

Attachment: shade_and_fill.ps
Description: PostScript document


[Thread Prev][Thread Next][Index]
Contact Us
Dept of Commerce / NOAA / OAR / PMEL / Ferret

Privacy Policy | Disclaimer | Accessibility Statement