Colour scheme without outline

My objective: to create a 340x36 png image of a GMT cpt file: the following almost gets me there

gmt psscale -Dx6.5/1+w340p/36p+h -B0 -Ccyclic --MAP_FRAME_PEN=0 > cyclic.eps
gmt psconvert -E72 -A+r -Tg cyclic.eps

But in spite of the zero frame pen, a light outline remains.

cyclic

I guess this is rasterisation artifact from ghostscript. Are there any tricks I can use to get rid of it?

I could make it a few pixels bigger and then shave them off with ImageMagick, but I’d really like to avoid that dependency on the processing.

Thanks in advance!

Jim

The issue is that a pen=0 does not mean zero thickness but a special thinnest that remains with the same width independently of a zoom level (in acrobat for example). The trick I used when I wasn’t able to get rid of a frame was to plot it fully transparent.

Yes, this also my trick to get ride of frames :slightly_smiling_face:.

However, currently I it looks for me as this does not work for the frame of a colorbar (like for the frame of a basemap) as the transparency of the pen used for the frame also affects the transparency of the colorbar itself:

gmt psbasemap -R-1/1/-1/1 -JX5c -B0 --MAP_FRAME_PEN=5p,red@70 > frame.eps

gmt psscale -Dx6.5/1+w340p/36p+h -B0 -Ccyclic --MAP_FRAME_PEN=5p,red@70 > cyclic.eps

And for a completely transparent frame, the colorbar is also completely transparent… :see_no_evil_monkey:

Hmmm, this looks like a bug to me.

I don’t have a good solution here. Maybe you can use a white pen instead or any color that matches the background.

I don’t have a Illustrator anymore to confirm it, but I have the impression that the border line is already burned to the image and that is why we cannot separate the transparencies.

I think this is actually a “real” PostScript hairline, at the end of the file, after the image block is

2 setlinecap
N 0 600 M 5667 0 D S
N 0 0 M 0 600 D S
N 5667 0 M 0 600 D S
N 0 0 M 5667 0 D S

inspecting the bottom left of the ps at high zoom in gv shows

but when I comment those lines out:

So possibly some dirty awk hack will fix this …

It seems to violate the “principle of least surprise” :grin:

See Fix option -B+n in psscale by joa-quim · Pull Request #8737 · GenericMappingTools/gmt · GitHub

2 Likes

That’s fabulous Joaquim, thanks very much :smiley: