[Top][All Lists]

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

Re: Jittery text in successive PostScript sequences

From: Paul Wessel
Subject: Re: Jittery text in successive PostScript sequences
Date: Tue, 23 Jan 2018 14:53:02 -1000

Quicktime says it is 2000x1250 and that is indeed the frame PNG dimensions - perhaps you are viewing it in a browser which shows it to be smaller.  in my browser it looks much smaller as well.
Anyway, we are trying to quantify if indeed it is -/+1 pixel which makes sense in terms of rounding.  I thought the anti-aliasing settings would add the gray to nearby pixels to simulate the sub-pixeling but that does not seem to happen on the projected tex [it does happen on other text that we have examined].


On Jan 23, 2018, at 2:00 PM, Bradley C. Kuszmaul <address@hidden> wrote:

This video is only 800x500, and the jitter's amplitude appears to be one pixel.

On Tue, Jan 23, 2018 at 3:52 PM, Paul Wessel <address@hidden> wrote:
Seems resolution independent; I've tried up to 4K.  Here is a 2000x1250 MP4 movie, just showing the text HELL. It is especially noticeable for angles 20-30.

On Jan 23, 2018, at 5:59 AM, Bradley C. Kuszmaul <address@hidden> wrote:

It looks like even the straight lines and circles have jaggies, and your jittering looks like it's just jaggies spread across the time domain.  I don't think you can expect it to look good at such low resolution without taking a lot more care about anti-aliasing. Can you increase the resolution?

Bradley C Kuszmaul - via snartphone

On Jan 22, 2018 10:06 PM, "Paul Wessel" <address@hidden> wrote:
Hi developers-

GMT (gmt.soest.hawaii.edu) is using PostScript to make plots and one application builds an animation from sequences of PostScript plots converted to PNG with ghostscript (9.22) and then to MP4 with ffmpeg.  We have found a problem that may be a ghostscript bug, or alternatively we are doing something wrong.  When using a perspective view (i.e., using a matrix concatenation to simulate perspective), the resulting oblique text strings "jitter" when viewed as a movie.  For an example, see www.soest.hawaii.edu/pwessel/bug_200.mp4.  As the movie plays, you will see the INDIVIDUAL letters in the word HELL jitter relative to each other, despite being set via a single show command (here just a snippet of our code; setting currentpoint, font etc are omitted here)

(HELL) dup dup stringwidth pop -2 div exch sh -2 div rmoveto show

where sh is defined as

/sh {gsave matrix setmatrix 0 0 moveto true charpath flattenpath pathbbox newpath 4 1 roll pop pop pop grestore} bind def

[a complete PS example of a single frame can be found here: www.soest.hawaii.edu/pwessel/bug.ps.

At first we suspected flattenpath but HELL (using Helvetica) has no curved segments (?).  We also tried to override the flattening with 0.2 setflat, but no difference.  We suspect some sort of roundoff but it affects the different letters in the word differently, and that is not under our control.  Could any of the operators above be subject to round-off that affect individual letters?

Perhaps developers know where this may happen and if there is anything we can do on our side to remedy the problem.  As you can see there is no jittering for plotting a circle or lines.  The map frame annotations show the same jittering so it affects all text.

Thanks for any insight!  We can provide more details, all individual PS files, etc upon request. FYI, we have tried both tif and jpg instead of png but no difference. We also made PDFs and used OS X Automator to build PNGs and made a movie using QuickTime Pro; same jittering (not sure if OS X High Sierra uses ghostscript in Preview etc).

Paul Wessel
Lead developer
The Generic Mapping Tools

reply via email to

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