[Thread Prev][Thread Next][Index]

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



Hi all,

Pyferret does have controls for working with antialiasing. See this page, 
https://ferret.pmel.noaa.gov/Ferret/documentation/pyferret/graphics


Thank you for the information!  The option makes it clear that I was wrong in thinking this is a typical antialiasing problem:

!! let outline = 0.05
let outline = 0
let ypixels = 2400
!! let ypixels = 4800
!! let ypixels = 9600

set data coads_climatology

set window/outline=`outline`
fill/L=1 SST; go fland
frame/ypixels=`ypixels`/file=tmp-aa.png

set window/outline=`outline`/noantialias
fill/L=1 SST; go fland
frame/ypixels=`ypixels`/file=tmp-na.png

With and without antialiasing, the land (plotted by go fland) has very clear horizontal white stripes.  Using outline=0.05 ameliorates the problem but doesn't eradicate the white lines.

So, there is some error in plotting polygons for PNG output.  When the northern latitude of one color-painted box coincides with the southern latitude of the adjacent box to the north, the PNG renderer that PyFerret uses somehow creates a wide gap between the two boxes (*footnote*).

Somehow, the PDF generator doesn't do that.

So, I guess the conclusions are

- For PNG output, adjust the outline value and the pixel resolution (through xpixels and ypixels) to eliminate or reduce the white lines.

- If you want a solution that always works, output to PDF and convert it to a raster image at a very high resolution with anti-aliasing switched off.  If you need a low-resolution image, resize this high-resolution raster image.

Best regards,

Ryo

------
Serena, I don't know what's wrong with your Imagemagick command, sorry.   I'm sure you can do it with ghostscript (the "gs" command).  I even suspect that the "convert" command uses ghostscript internally.

Another (stupid) solution is, open the PDF image with Acrobat Reader, turn off "Smooth line art" option, and capture the screen!
-----
(*footnote*) I tried importing the PDF file into GIMP.  The raster image GIMP creates has white lines, with or without anti-aliasing.  There must be something hard to solve in this problem.


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

Privacy Policy | Disclaimer | Accessibility Statement