[Thread Prev][Thread Next][Index]

Re: [ferret_users] Frame/file= and Framing of the output image



Thanks for your reply, Andrew,
I previously tried your solution that I found on gitub, but I used a png output, which worsened the results (it added colored lines onto the map, and not only on the coasts). Now trying the pdf format (with PyFerret 7.63 and nodisplay), I can report that it works well. However, I am not fully satisfied with the shading of the field I plot. It looks more like colored lines than colored areas. (I guess it's normal and I should "Rasterize" the resulting PDF as suggested by Ryo. But it seems a lot of work around to get my graphic outputs).
So, I went back to the PyFerret 7.5 to get nice png outputs. The behavior with the nodisplay option is exactly the same as with PyFerret 7.63 (PNG with horizontal lines, PDF improved with the set win/outline command). 
Note that PyFerret 7.5 without the nodisplay option create perfect PNG images, but the PDF is badly framed (I end up having only the lop left quarter or the map).

I do agree with Ryo and hope that PyFerret will be modified so that the framing will be improved and that white lines don't happen in the PNG outputs.

Have a nice day,

Serena

.¸. , . .·´¯`·
 ><(((º>     `·.¸.·´¯`·...¸><(((º>¸.¸. , . .·´¯`· ><(((º> .
`·.¸.·´¯`·...¸><(((º>                                                    .
                                                                                  .
  Serena ILLIG-THEVENIN       LEGOS/IRD             .
                                                                                  .
  Editorial Board Member for Scientific Reports      .
                                                                              .
                         14 Av. E. Belin                           .
                         31400 Toulouse                        .
                         FRANCE                                   .
                                                                             .
         E-mail : serena.illig.ird@xxxxxxxxx             .
         Web-site : http://sillig.free.fr                       .
         Phone : +33 5 61 33 29 26                      .
                                                                       .
                                                     <º)))><..·



On Thu, Jul 7, 2022 at 6:22 PM Andrew Wittenberg - NOAA Federal <andrew.wittenberg@xxxxxxxx> wrote:
One easy adjustment is to have PyFerret automatically draw thin outlines around its polygons, effectively covering up the thin white lines (grid pattern) that result from antialiasing, which blends into the background color (typically white).

From the PyFerret documentation:


SET WINDOW /OUTLINE=

When drawing color-filled rectangles and other polygons, this option allows one to specify the thickness of a outline to be drawn around each polygon. The color of the outline will be the same as the fill color. The main purpose of this option is to provide a work-around fix to some PostScript and PDF viewers that show thin white lines in FILL and SHADE plots. Typically only a very small value (0.05) is needed for this fix. If a value of zero is given, these outlines will not be drawn. The default behavior is to not draw these outlines.

Don't set this value too high though, or the outlines will become visible and start to overlap adjacent polygons.  (If you try setting it very high, you'll see what I mean.)

Andrew

---
Dr. Andrew T. Wittenberg
NOAA Geophysical Fluid Dynamics Laboratory


On Thu, Jul 7, 2022 at 5:35 AM Ryo Furue <furue@xxxxxxxxxx> wrote:
Dear Serena,

On Thu, Jul 7, 2022 at 5:09 PM Serena Illig <serena.illig.ird@xxxxxxxxx> wrote:
Dear Ryo,
I replied to fast.
With the latest version of PyFerret, when I use FRAME with the -nodisplay -scrip options, I end up having white horizontal lines over the coast topography (go fland 5 black)

That's a long-standing known problem, not only with Ferret but also with all sorts of graphical packages.

Search Google with "white thin lines PDF" without the quotation marks.  Also search the email archive of Ferret.

But the workaround is

1. Create a PDF file instead of PNG.
2. Rasterize it with antialiasing switched off, if the PDF file shows the thin white lines.

On the Net, You'll find a lot of discussion about the relation between antialiasing and the white lines.  Google again for "rasterization".

I guess the graphical engine for "-nodisplay" uses antialiasing and as a result, bakes white lines in the PNG image.  I hope PyFerret will be modified so that the white lines don't happen in the PNG images it produces.

Cheers,

Ryo


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

Privacy Policy | Disclaimer | Accessibility Statement