Re: gm convert -draw TEXT is buggy

Bob Friesenhahn <[email protected]> Wed, 23 Sep 2015 21:24:52 -0500 (CDT)
Newsgroups gmane.comp.video.graphicsmagick.bugs
Message-ID <[email protected]>
On Thu, 24 Sep 2015, [email protected] wrote:

> The command:
>
> gm convert -font courier-bold -pointsize 10 -fill black \
> -draw "text 0,12 'SCHLOSS AHRENSBURG'" \
> ahrensburg.jpg ahrensburg.jpg
>
> The first attached image 'orig.png' is a section of
> the original image.
>
> The second attached image 'with-text.png' is the result
> of adding text.
>
> As you can see: not only text is added, but a halo.
> This obviously is a bug.

What you call a halo looks like JPEG compression artifacts to me.  I 
see lots of other apparent JPEG compression artifacts in your image, 
such as around the steeple.  JPEG does a poor job of compressing image 
content with sharp edges (such as text, or edges of objects).  Try 
saving to a lossless format like PNG or use a much higher quality 
level.

If the original image used a high quality factor, it might be lost 
since GraphicsMagick uses the libjpeg default by default.

Use

~~~~~~~~~~~~~~~~~~~~

gm convert old.jpg -define jpeg:preserve-settings new.jpg

~~~~~~~~~~~~~~~~~~~~

so that the original quality settings are used when saving new.jpg

Use 'gm display orig.png' and press the middle mouse button somewhere 
on the image to bring up the magnifier.  Hold the middle mouse button 
down and move the mouse in order to pan around in the image and see it 
at higher detail.  The compression artifacts are immediately apparent.

Bob
-- 
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/

------------------------------------------------------------------------------
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140